Dirk Lattermann
unread,Nov 27, 2016, 8:01:29 AM11/27/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ceylon...@googlegroups.com
Don't know if the following is expected or a compiler bug, so I rather
ask here than submitting an issue. Must I really write all documentation
into the the top "shared annotation..." line?
For Ceylon 1.3.1 (from IntelliJ using "Rebuild project"), the following
gives
`Error:(22, 20) ceylon: compiler bug: annotation constructors may
only contain a return statement`.
No error markers in the editor window are shown.
```ceylon
"Annotates a method to define an HTTP endpoint."
shared annotation EndpointAnnotation endpoint(path="", method=get,
consumes=[], produces=[]) {
"The path under which the endpoint is served.
See [[de.dlkw.conjurup.core::Server.addEndpoint]] and
[[de.dlkw.conjurup.core::EndpointScanner]]."
String path;
"The HTTP method for accessing the endpoint."
AbstractMethod method;
"A list of MIME types that the endpoint accepts. \"\\*/\\*\" can be
used to mean any MIME type. Specifying empty (default) is equivalent
to [\"\\*/\\*\"]."
String[] consumes;
"A list of MIME types that the endpoint can produce.
\"\\*/\\*\" may of course not be used. The value used if empty
(default) is specified depends on the HTTP method:
[\"application/x-www-form-urlencoded\"] for POST, [\"text/plain\"]
otherwise." String[] produces;
return EndpointAnnotation(path, method, consumes, produces);
}
```