Variable declarantions yield parse errors (headless statements and definite types) #634

SebastianS90 opened this Issue Apr 23, 2016 · 3 comments


None yet

2 participants


This program does not compile. "unrecognized term" for for the function keyword.

type myint is int

public export method test():
    function()->(myint) m = &(-> 1)

The same holds for methods.

The problem is that we end up being here after parseDefiniteType returns null because mustParseAsType thinks we could parse it as expression.

Why not return true here? I cannot think of an expression that starts with a function or method keyword.


Even shorter and probably the proof that relying on parameter/return types does not make sense:

public export method test():
    method()->() m = &test

I tried it, does not affect any existing tests. See #635

And this issue here should auto-close when you press merge because develop is now the default branch.


And so it did ... (autoclose, that is)

@DavePearce DavePearce modified the milestone: v0.3.40 May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment