#.require. jvm namespace Test class Test def main is shared s as String = 'aoeu' assert s is s t1 as String = 'ao' t2 as String = 'eu' if s.length==4 # the condition forces t to be constructed at runtime t as String = t1 + t2 else t as String = '' assert s==t assert not CobraImp.referenceEquals(s, t) assert s is not t assert t is not s # for primitives like int, "is" is synonymous with "==" (and "is not" -> "<>") x as int = 5 assert 5 is 5 # .warning. value types assert x is 5 # .warning. value types assert 5 is x # .warning. value types assert x == x # TODO warning. same variable y as int = 5 assert x is y # .warning. value types assert y is x # .warning. value types y = 6 assert x is not y # .warning. value types