ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

syntax error with invocation of grouped expression of base expression #1456

Closed jvasileff closed 8 years ago

jvasileff commented 8 years ago

These are unusual, but should be allowed, right?

class A {
    shared new create() {}
    shared String foo() => "";

    Anything a1 = (create)(); // incorrect syntax: no viable alternative at token ';'
    Anything a2 = (foo)(); // incorrect syntax: no viable alternative at token ';'
}
lucaswerkmeister commented 8 years ago

you’re missing a semicolon at the end of foo() => ""

jvasileff commented 8 years ago

Thanks @lucaswerkmeister , fixed.

lucaswerkmeister commented 8 years ago

oh, there’s still a syntax error… I thought that would fix it. Huh.

jvasileff commented 8 years ago

Hah, my example was full of errors. Just fixed s/bar/create.

gavinking commented 8 years ago

Is that better, @jvasileff?

jvasileff commented 8 years ago

@gavinking if it allows me to write (create)(), I'm sure my code will be much more legible going forward.