Skip to content

Instantly share code, notes, and snippets.



Last active Jun 24, 2019
What would you like to do?
package metaobjectTest
Annotation 'letter' should be attached to a Char in a variable
declaration. It checks whether a value assigned to the
variable is a letter.
object Letter
func run {
var Char@letter ch;
ch = 'a'; // ok
// compile-time error if uncommented
// ch = '#';
var Char other = '#';
var ok = false;
ch = other; // runtime error
} catch: { (: CyException e :)
ok = true
assert ok;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment