Compiler expected a valid identifier to follow a colon (:) in the function signature but found something else.
:
E.g. consider this example:
function bar():
The function definition ends with a colon implying a return type, but there is none defined. Or:
function bar(): 5
Compiler found an integer literal, where a name of the type was expected.
add one of the known types after the colon:
function bar(): int
if function returns nothing, delete : after arguments list
function bar()
Last updated 1 year ago