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

support direct invocations on grouped expressions #659

Closed
jvasileff opened this issue Oct 24, 2015 · 3 comments
Closed

support direct invocations on grouped expressions #659

jvasileff opened this issue Oct 24, 2015 · 3 comments
Milestone

Comments

@jvasileff
Copy link
Member

Direct invocations on grouped expressions do not currently work:

shared void run() {
    value a = ("hello ".plus) { "world"; };   
    value b = (("hello ".plus)) { "world"; }; 
    value c = 1.plus { 2; };        
    value d = (1.plus) { 2; };      
    value e = ((1.plus)) { 2; };    
    //value f = (Singleton)(10);

    print ({a,b,c,d,e});
}

prints:

{ ceylon.language::JsCallable@1, ceylon.language::JsCallable@2, 3, ceylon.language::JsCallable@3, ceylon.language::JsCallable@4 }

Uncommenting the value f line results in:

/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.2.0/ceylon.language-1.2.0.js:5189
$1an_=$1an;$_Object(singleton$);Sequence({Element$Sequence:$$targs$$.Element$S
                                                                    ^
TypeError: Cannot read property 'Element$Singleton' of undefined
    at Object.Singleton (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.2.0/ceylon.language-1.2.0.js:5189:80)
    at run (/Users/jvasileff/Dropbox/Repos/jv/simple/modules/simple/1.0.0/simple-1.0.0.js:36:12)

See also ceylon/ceylon-spec#1449

@chochos
Copy link
Member

chochos commented Nov 11, 2015

But this is a new feature, right?

@gavinking
Copy link
Member

It's not new, but I now think the typechecker should actually disallow all these things.

@gavinking
Copy link
Member

Moved.

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

No branches or pull requests

3 participants