Question

What causes the error “Error: closeparen expected” as in

method test(int i) {}

producing

ERROR_CloseParen.dfy(1,12): Error: closeparen expected
1 parse errors detected in ERROR_CloseParen.dfy

Answer

You are writing a Java/C parameter declaration. In Dafny, parameter declarations have the form name: type, so

method test(i: int) { ... }