{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/5917","labels_url":"https://api.github.com/repos/ceylon/ceylon/issues/5917/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon/issues/5917/comments","events_url":"https://api.github.com/repos/ceylon/ceylon/issues/5917/events","html_url":"https://github.com/ceylon/ceylon/issues/5917","id":126942526,"number":5917,"title":"Impossible to give a Java class to an annotation","user":{"login":"renatoathaydes","id":1901277,"avatar_url":"https://avatars.githubusercontent.com/u/1901277?v=3","gravatar_id":"","url":"https://api.github.com/users/renatoathaydes","html_url":"https://github.com/renatoathaydes","followers_url":"https://api.github.com/users/renatoathaydes/followers","following_url":"https://api.github.com/users/renatoathaydes/following{/other_user}","gists_url":"https://api.github.com/users/renatoathaydes/gists{/gist_id}","starred_url":"https://api.github.com/users/renatoathaydes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renatoathaydes/subscriptions","organizations_url":"https://api.github.com/users/renatoathaydes/orgs","repos_url":"https://api.github.com/users/renatoathaydes/repos","events_url":"https://api.github.com/users/renatoathaydes/events{/privacy}","received_events_url":"https://api.github.com/users/renatoathaydes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2016-01-15T19:41:12Z","updated_at":"2016-01-16T05:44:36Z","closed_at":null,"body":"It's quite common for Java frameworks to have annotations that expect a Java `java.lang.Class<?>` as a parameter. These annotations are impossible to be used in Ceylon because only literals can be passed to annotations.\r\n\r\nExample:\r\n\r\n```ceylon\r\nautoService(javaClass<Runnable>()) class XXX() {}\r\n```\r\n\r\nCauses an error:\r\n\r\n```\r\nIllegal annotation argument: must be a literal value, metamodel reference, annotation instantiation, or parameter reference\r\n```\r\n\r\nI cannot confirm either doing:\r\n\r\n```ceylon\r\nautoService(`interface Runnable`) class XXX() {}\r\n```\r\n\r\nactually works (ie. the Java annotation processor does get the right type `java.lang.Class<Runnable>`... but if it does, then it must be because the Ceylon compiler goes and replaces the `Type<Runnable>` with the expected `Class<Runnable>`... but then why can't the Ceylon compiler simply be consistent and forget about the `javaClass<>()` function entirely and ALWAYS do this everywhere, not only in some kind of special-cases that no ones knows of and seem totally arbitrary?"},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/comments/172161334","html_url":"https://github.com/ceylon/ceylon/issues/5917#issuecomment-172161334","issue_url":"https://api.github.com/repos/ceylon/ceylon/issues/5917","id":172161334,"user":{"login":"renatoathaydes","id":1901277,"avatar_url":"https://avatars.githubusercontent.com/u/1901277?v=3","gravatar_id":"","url":"https://api.github.com/users/renatoathaydes","html_url":"https://github.com/renatoathaydes","followers_url":"https://api.github.com/users/renatoathaydes/followers","following_url":"https://api.github.com/users/renatoathaydes/following{/other_user}","gists_url":"https://api.github.com/users/renatoathaydes/gists{/gist_id}","starred_url":"https://api.github.com/users/renatoathaydes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renatoathaydes/subscriptions","organizations_url":"https://api.github.com/users/renatoathaydes/orgs","repos_url":"https://api.github.com/users/renatoathaydes/repos","events_url":"https://api.github.com/users/renatoathaydes/events{/privacy}","received_events_url":"https://api.github.com/users/renatoathaydes/received_events","type":"User","site_admin":false},"created_at":"2016-01-16T05:44:36Z","updated_at":"2016-01-16T05:44:36Z","body":"@jvasileff Using `header.string` worked... so I guess I should've read the docs more closely after all :)"}}