{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon-js/issues/570","labels_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/570/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/570/comments","events_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/570/events","html_url":"https://github.com/ceylon/ceylon-js/issues/570","id":82023658,"number":570,"title":"Lots of errors when compiling native(\"jvm\") module, “not meant for this backend” error can disappear","user":{"login":"lucaswerkmeister","id":2346599,"avatar_url":"https://avatars.githubusercontent.com/u/2346599?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswerkmeister","html_url":"https://github.com/lucaswerkmeister","followers_url":"https://api.github.com/users/lucaswerkmeister/followers","following_url":"https://api.github.com/users/lucaswerkmeister/following{/other_user}","gists_url":"https://api.github.com/users/lucaswerkmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswerkmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswerkmeister/subscriptions","organizations_url":"https://api.github.com/users/lucaswerkmeister/orgs","repos_url":"https://api.github.com/users/lucaswerkmeister/repos","events_url":"https://api.github.com/users/lucaswerkmeister/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswerkmeister/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-28T16:46:29Z","updated_at":"2015-10-05T22:14:40Z","closed_at":null,"body":"If I compile an empty module with the following module descriptor (modeled after `ceylon.ast.redhat`):\r\n```ceylon\r\nnative (\"jvm\")\r\nmodule tmp \"1.1.1\" {\r\n    shared import ceylon.ast.core \"1.1.1\";\r\n    shared import com.redhat.ceylon.typechecker \"1.1.1\";\r\n    import ceylon.interop.java \"1.1.1\";\r\n}\r\n```\r\nI get the following errors:\r\n> error encountered [cannot find module artifact com.redhat.ceylon.typechecker-1.1.1.js\r\n\t- dependency tree: tmp/1.1.1 -> com.redhat.ceylon.typechecker/1.1.1] at 4:4-4:55 of module.ceylon\r\nerror encountered [Module not meant for this backend: tmp] at 2:7-2:9 of module.ceylon\r\nerror encountered [cannot find module artifact ceylon.interop.java-1.1.1.js\r\n\t- dependency tree: tmp/1.1.1 -> ceylon.interop.java/1.1.1] at 5:4-5:38 of module.ceylon\r\n3 errors.\r\n\r\nI think any errors other than the “Module not meant for this backend” shouldn’t be there.\r\n\r\nEven worse: If I copy the `Continue.ceylon` file from `ceylon.ast.redhat` over:\r\n```ceylon\r\nimport ceylon.ast.core {\r\n    Continue\r\n}\r\nimport com.redhat.ceylon.compiler.typechecker.tree {\r\n    Tree {\r\n        JContinue=Continue\r\n    }\r\n}\r\n\r\n\"Converts a RedHat AST [[Continue|JContinue]] to a `ceylon.ast` [[Continue]].\"\r\nshared Continue continueToCeylon(JContinue \\icontinue) {\r\n    return Continue();\r\n}\r\n\r\n\"Compiles the given [[code]] for a Continue\r\n into a [[Continue]] using the Ceylon compiler\r\n (more specifically, the rule for a `continue`).\"\r\nshared Continue? compileContinue(String code) {\r\n    if (is JContinue jDirectiveStatement = createParser(code).directiveStatement()) {\r\n        // continueDirective doesn’t contain the semicolon\r\n        return continueToCeylon(jDirectiveStatement);\r\n    } else {\r\n        return null;\r\n    }\r\n}\r\n```\r\nI get the following errors:\r\n> Error: Errors found. Compilation stopped.\r\nNote: Created module tmp/1.1.1\r\nerror encountered [type declaration does not exist: 'JContinue'] at 19:11-19:19 of Continue.ceylon\r\nerror encountered [could not determine type of function or value reference: 'continueToCeylon'] at 21:15-21:30 of Continue.ceylon\r\nerror encountered [parameter type could not be determined: 'continue' of 'continueToCeylon'] at 21:32-21:50 of Continue.ceylon\r\nerror encountered [type declaration does not exist: 'JContinue'] at 11:33-11:41 of Continue.ceylon\r\nerror encountered [package not found in imported modules: 'com.redhat.ceylon.compiler.typechecker.tree' (add module import to module descriptor of 'tmp')] at 4:7-4:49 of Continue.ceylon\r\nerror encountered [function or value does not exist: 'createParser'] at 19:43-19:54 of Continue.ceylon\r\nwarning encountered [declaration does not exist: 'JContinue'] at 10:25-10:42 of Continue.ceylon\r\nceylon compile-js: 7 errors.\r\n\r\nThe “Module not meant for this backend” error vanished!"},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon-js/issues/comments/145685074","html_url":"https://github.com/ceylon/ceylon-js/issues/570#issuecomment-145685074","issue_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/570","id":145685074,"user":{"login":"quintesse","id":778793,"avatar_url":"https://avatars.githubusercontent.com/u/778793?v=3","gravatar_id":"","url":"https://api.github.com/users/quintesse","html_url":"https://github.com/quintesse","followers_url":"https://api.github.com/users/quintesse/followers","following_url":"https://api.github.com/users/quintesse/following{/other_user}","gists_url":"https://api.github.com/users/quintesse/gists{/gist_id}","starred_url":"https://api.github.com/users/quintesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quintesse/subscriptions","organizations_url":"https://api.github.com/users/quintesse/orgs","repos_url":"https://api.github.com/users/quintesse/repos","events_url":"https://api.github.com/users/quintesse/events{/privacy}","received_events_url":"https://api.github.com/users/quintesse/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T22:14:40Z","updated_at":"2015-10-05T22:14:40Z","body":"> if you're compiling several modules in one go, ignoring the jvm-only modules seems the right thing to do\r\n\r\nIf you're specifically mentioning the module on the command line it should definitely give the error. Only if you do something like `ceylon compile-js '*'` should JVM modules be ignored, but the `ModuleWildcardsHelper` already takes care of that for you."}}