{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/5904","labels_url":"https://api.github.com/repos/ceylon/ceylon/issues/5904/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon/issues/5904/comments","events_url":"https://api.github.com/repos/ceylon/ceylon/issues/5904/events","html_url":"https://github.com/ceylon/ceylon/issues/5904","id":126029340,"number":5904,"title":"errors using class alias of constructors as types in JS","user":{"login":"jvasileff","id":236050,"avatar_url":"https://avatars.githubusercontent.com/u/236050?v=3","gravatar_id":"","url":"https://api.github.com/users/jvasileff","html_url":"https://github.com/jvasileff","followers_url":"https://api.github.com/users/jvasileff/followers","following_url":"https://api.github.com/users/jvasileff/following{/other_user}","gists_url":"https://api.github.com/users/jvasileff/gists{/gist_id}","starred_url":"https://api.github.com/users/jvasileff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvasileff/subscriptions","organizations_url":"https://api.github.com/users/jvasileff/orgs","repos_url":"https://api.github.com/users/jvasileff/repos","events_url":"https://api.github.com/users/jvasileff/events{/privacy}","received_events_url":"https://api.github.com/users/jvasileff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-11T20:26:48Z","updated_at":"2016-01-11T20:42:50Z","closed_at":null,"body":"This happens:\r\n```ceylon\r\nshared class C {\r\n    shared Integer i;\r\n    shared new (Integer a) {\r\n        this.i = a;\r\n    }\r\n    shared new create(Integer a, Integer b) {\r\n        this.i = a + b;\r\n    }\r\n}\r\n\r\nshared class CAlias(Integer x) => C(x);\r\nshared class CCreateAlias(Integer x, Integer y) => C.create(x, y);\r\n\r\nshared void runX() {\r\n    Anything c = CAlias(10);\r\n    Anything cc = CCreateAlias(10, 20);\r\n\r\n    assert ((c of Anything) is C); // ok\r\n    assert ((c of Anything) is CAlias); // ok\r\n    assert ((c of Anything) is CCreateAlias); // TypeError: Cannot read property 'T$name' of undefined\r\n    assert ((cc of Anything) is C); // ok\r\n    assert ((cc of Anything) is CAlias); // ok\r\n    assert ((cc of Anything) is CCreateAlias); // TypeError: Cannot read property 'T$name' of undefined\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/comments/170683956","html_url":"https://github.com/ceylon/ceylon/issues/5904#issuecomment-170683956","issue_url":"https://api.github.com/repos/ceylon/ceylon/issues/5904","id":170683956,"user":{"login":"jvasileff","id":236050,"avatar_url":"https://avatars.githubusercontent.com/u/236050?v=3","gravatar_id":"","url":"https://api.github.com/users/jvasileff","html_url":"https://github.com/jvasileff","followers_url":"https://api.github.com/users/jvasileff/followers","following_url":"https://api.github.com/users/jvasileff/following{/other_user}","gists_url":"https://api.github.com/users/jvasileff/gists{/gist_id}","starred_url":"https://api.github.com/users/jvasileff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvasileff/subscriptions","organizations_url":"https://api.github.com/users/jvasileff/orgs","repos_url":"https://api.github.com/users/jvasileff/repos","events_url":"https://api.github.com/users/jvasileff/events{/privacy}","received_events_url":"https://api.github.com/users/jvasileff/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T20:42:50Z","updated_at":"2016-01-11T20:42:50Z","body":"The four errors below appear to be the same, but for `interface` aliases:\r\n\r\n```ceylon\r\ninterface I {\r\n    shared default String id => \"I\";\r\n}\r\n\r\ninterface IAlias => I;\r\ninterface IAliasAlias => IAlias;\r\n\r\nclass C() satisfies I {\r\n    shared actual String id => \"C\";\r\n    shared String id_i => super.id;\r\n    shared String id_iAlias => (super of IAlias).id;\r\n    shared String id_iAliasAlias => (super of IAliasAlias).id;\r\n}\r\n\r\nshared void runX() {\r\n    value c = C();\r\n\r\n    assert (c.id == \"C\");\r\n    assert (c.id_i == \"I\");\r\n    assert (c.id_iAlias == \"I\");\r\n    assert (c.id_iAliasAlias == \"I\");\r\n\r\n    assert ((c of Anything) is I);\r\n    assert ((c of Anything) is IAlias); // error\r\n    assert ((c of Anything) is IAliasAlias); // error\r\n\r\n    assert (!(\"\" of Anything) is I);\r\n    assert (!(\"\" of Anything) is IAlias); // error\r\n    assert (!(\"\" of Anything) is IAliasAlias); // error\r\n}\r\n```"}}