symbolToString
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
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"; | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment