Code from Language Reference not working
stefandd opened this issue · comments
stefandd commented
def function_type(int) -> int
def g(f:function_type): return 1 + f(2)
as discussed in http://aardappel.github.io/lobster/language_reference.html returns the error:
.lobster(1): error: identifier expected, found: int
Wouter van Oortmerssen commented
Ah yes, there currently needs to be e.g. def function_type(a:int) -> int
. We could in theory support the syntax without an identifier, but in the current syntax the parser only knows its a function type one it sees there is no function body.. so I guess for now we'll just fix the docs: c7e82af