fix callcombo #901

Closed
wants to merge 2 commits into
from

Projects

None yet

1 participant

@zhaihj
Contributor
zhaihj 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