Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package metaobjectTest
Annotation 'symbolToString' takes a single parameter and produces
a string whose contents is the parameter. Then the annotation is
an expression of type String.
This annotation is used mainly in generic prototypes to convert
a generic parameter to a string.
object SymbolToString
func run {
var String aa = @symbolToString(SymbolToString);
assert aa == "SymbolToString";
aa = @symbolToString("Int");
assert aa == "Int";
aa = @symbolToString(T);
assert aa == "T";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment