V version:
0.1.27
Running 'v fmt' on following code will keep allocating memory until the OS runs out.
I realize this is not V code, nevertheless an error should be returned as soon as the formatting fails
module main
type callback fn (int,const char*[])
@duarteroso It's more on the parser's problem than vfmt (Can confirm that it does the same thing on the compiler). Thanks for reporting.
Infinite looping has been prevented in 75b8822 (it does not check for the exact syntax that failed, but it should stop after 50 unsuccessful attempts to continue after .eof)
It now prints: 
Fixed in newer versions of V:
testy.v:3:35: error: use `&Type` instead of `*Type` when declaring references
1 | module main
2 |
3 | type callback = fn (int,const char*[])
| ^
vfmt error while formatting file: testy.v .
Encountered a total of: 1 errors.
Most helpful comment
@duarteroso It's more on the parser's problem than vfmt (Can confirm that it does the same thing on the compiler). Thanks for reporting.