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

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

Closed
jvasileff opened this issue Oct 30, 2015 · 6 comments
Closed
Labels
Milestone

Comments

@jvasileff
Copy link
Member

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
Copy link
Member

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

@jvasileff
Copy link
Member Author

Thanks @lucaswerkmeister , fixed.

@lucaswerkmeister
Copy link
Member

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

@jvasileff
Copy link
Member Author

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

@gavinking
Copy link
Member

Is that better, @jvasileff?

@jvasileff
Copy link
Member Author

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

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

No branches or pull requests

3 participants