{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2075","labels_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2075/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2075/comments","events_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2075/events","html_url":"https://github.com/ceylon/ceylon-compiler/issues/2075","id":59223277,"number":2075,"title":"ModelError: Expected type or function or value","user":{"login":"marvelous","id":407928,"avatar_url":"https://avatars.githubusercontent.com/u/407928?v=3","gravatar_id":"","url":"https://api.github.com/users/marvelous","html_url":"https://github.com/marvelous","followers_url":"https://api.github.com/users/marvelous/followers","following_url":"https://api.github.com/users/marvelous/following{/other_user}","gists_url":"https://api.github.com/users/marvelous/gists{/gist_id}","starred_url":"https://api.github.com/users/marvelous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marvelous/subscriptions","organizations_url":"https://api.github.com/users/marvelous/orgs","repos_url":"https://api.github.com/users/marvelous/repos","events_url":"https://api.github.com/users/marvelous/events{/privacy}","received_events_url":"https://api.github.com/users/marvelous/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/annotations","name":"annotations","color":"207de5"},{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/BUG","name":"BUG","color":"e10c02"},{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/labels/IN%20PROGRESS","name":"IN PROGRESS","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/milestones/11","html_url":"https://github.com/ceylon/ceylon-compiler/milestones/1.2","labels_url":"https://api.github.com/repos/ceylon/ceylon-compiler/milestones/11/labels","id":809477,"number":11,"title":"1.2","description":"","creator":{"login":"tombentley","id":879487,"avatar_url":"https://avatars.githubusercontent.com/u/879487?v=3","gravatar_id":"","url":"https://api.github.com/users/tombentley","html_url":"https://github.com/tombentley","followers_url":"https://api.github.com/users/tombentley/followers","following_url":"https://api.github.com/users/tombentley/following{/other_user}","gists_url":"https://api.github.com/users/tombentley/gists{/gist_id}","starred_url":"https://api.github.com/users/tombentley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombentley/subscriptions","organizations_url":"https://api.github.com/users/tombentley/orgs","repos_url":"https://api.github.com/users/tombentley/repos","events_url":"https://api.github.com/users/tombentley/events{/privacy}","received_events_url":"https://api.github.com/users/tombentley/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":190,"state":"open","created_at":"2014-10-01T08:51:07Z","updated_at":"2015-02-27T15:05:53Z","due_on":"2014-11-02T23:00:00Z","closed_at":null},"comments":4,"created_at":"2015-02-27T11:17:08Z","updated_at":"2015-02-27T17:22:11Z","closed_at":"2015-02-27T15:05:53Z","body":"I have the following snipplet that compiles fine but throws when run.\r\n\r\nimport ceylon.language.meta.declaration {\r\n\tFunctionDeclaration,\r\n\tValueDeclaration\r\n}\r\nshared final annotation class MyAnnotation(shared FunctionDeclaration fun)\r\n\t\tsatisfies OptionalAnnotation&lt;MyAnnotation,ValueDeclaration> {}\r\nshared annotation MyAnnotation myAnnotation(FunctionDeclaration fun) => MyAnnotation(fun);\r\n\r\nmyAnnotation (\\`function run`)\r\nshared Anything x = 0;\r\n\r\nshared void run() {\r\n\tprint(\\`x`.declaration.annotations&lt;MyAnnotation>());\r\n}\r\n\r\nException in thread \"main\" java.lang.reflect.InvocationTargetException\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:104)\r\n\tat com.redhat.ceylon.launcher.Launcher.run(Launcher.java:37)\r\n\tat com.redhat.ceylon.launcher.Launcher.run(Launcher.java:30)\r\n\tat com.redhat.ceylon.launcher.Launcher.main(Launcher.java:23)\r\nCaused by: com.redhat.ceylon.compiler.java.runtime.metamodel.ModelError: While reflectively instantiating class MyAnnotation on element value x\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.newModelError(Metamodel.java:1448)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.addAnnotation(Metamodel.java:796)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.annotations(Metamodel.java:850)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.annotations(Metamodel.java:836)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.FreeNestableDeclaration.annotations(FreeNestableDeclaration.java:92)\r\n\tat run_.run(test.ceylon:13)\r\n\tat run_.main(test.ceylon)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat ceylon.modules.api.runtime.SecurityActions.invokeRunInternal(SecurityActions.java:58)\r\n\tat ceylon.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:48)\r\n\tat ceylon.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:101)\r\n\tat ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:167)\r\n\tat ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:151)\r\n\tat ceylon.modules.Main.execute(Main.java:69)\r\n\tat ceylon.modules.Main.main(Main.java:42)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat org.jboss.modules.Module.run(Module.java:312)\r\n\tat org.jboss.modules.Main.main(Main.java:460)\r\n\tat ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:208)\r\n\tat com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:352)\r\n\tat com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:291)\r\n\t... 8 more\r\nCaused by: java.lang.reflect.InvocationTargetException\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:408)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.addAnnotation(Metamodel.java:789)\r\n\t... 33 more\r\nCaused by: com.redhat.ceylon.compiler.java.runtime.metamodel.ModelError: Expected type or function or value at index 23: ::unversioned:default:.:Frun\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.newModelError(Metamodel.java:1448)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.newModelError(Metamodel.java:1443)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.DeclarationParser.parseError(DeclarationParser.java:52)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.DeclarationParser.declaration(DeclarationParser.java:181)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.DeclarationParser.package_(DeclarationParser.java:165)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.DeclarationParser.module(DeclarationParser.java:109)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.DeclarationParser.ref(DeclarationParser.java:75)\r\n\tat com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.parseMetamodelReference(Metamodel.java:1005)\r\n\tat MyAnnotation.&lt;init>(test.ceylon:5)\r\n\t... 38 more\r\nABRT problem creation: 'success'\r\n"},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/comments/76433040","html_url":"https://github.com/ceylon/ceylon-compiler/issues/2075#issuecomment-76433040","issue_url":"https://api.github.com/repos/ceylon/ceylon-compiler/issues/2075","id":76433040,"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-02-27T17:22:11Z","updated_at":"2015-02-27T17:22:11Z","body":"@marvelous There are no nightly builds right now, hopefully that will change once we release 1.2 (Real Soon Now). Right now the only way is to follow the steps described here: http://www.ceylon-lang.org/code/contribute/\r\nHTH"}}