Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix callcombo #901

Closed
wants to merge 2 commits into from
Closed

fix callcombo #901

wants to merge 2 commits into from

Conversation

horasal
Copy link
Contributor

@horasal horasal commented Jul 10, 2015

Test code:

foo: class{
    v : Int
    isOdd :Bool {
        get { v % 2 == 1 }
    }

    isEven ::= v %2 == 0

    init: func

    test: func -> Func(Int) {
        return func(a: Int){ a toString() println()}
    }
}

bar := foo new()

a := bar test()
a(1)

bar test()(1)

bar test()(1) can not be correctly recognized in this case.
Parser may break callcombo into two function call bar test() and null ().

This commit fix this problem.

Another testcase:(should throw error that can not call on void function instead of crash)

//!shouldfail

foo: class{
    v : Int
    isOdd :Bool {
        get { v % 2 == 1 }
    }

    isEven ::= v %2 == 0

    init: func

    test: func {}
}

bar := foo new()

bar test()()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant