Parameter declaration/documentation in annotation functions

17 views
Skip to first unread message

Dirk Lattermann

unread,
Nov 27, 2016, 8:01:29 AM11/27/16
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);
}
```

Gavin King

unread,
Nov 27, 2016, 10:59:38 AM11/27/16
to ceylon...@googlegroups.com
Hrm, yeah, I guess I would say it's a bug. Could you please submit an issue?
> --
> You received this message because you are subscribed to the Google Groups "ceylon-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
> To post to this group, send email to ceylon...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ceylon-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/20161127140127.5853c7af%40dinu.
> For more options, visit https://groups.google.com/d/optout.



--
Gavin King
ga...@ceylon-lang.org
http://profiles.google.com/gavin.king
http://ceylon-lang.org
http://hibernate.org
http://seamframework.org

Dirk Lattermann

unread,
Nov 27, 2016, 11:57:56 AM11/27/16
to ceylon...@googlegroups.com
Am Sun, 27 Nov 2016 16:59:16 +0100
schrieb Gavin King <gavin...@gmail.com>:

> Hrm, yeah, I guess I would say it's a bug. Could you please submit an
> issue?

ok, #6766.
Reply all
Reply to author
Forward
0 new messages