mixin Values get one as int return 1 def two as int return 2 def sum as int total = .one # test using a local var total += .two return total def moreLocalVarTesting if true a = 1 # test local var inside a compound statement CobraCore.noOp(a) while false b = 1 CobraCore.noOp(b) if false using tr = File.openText('foo') pass mixin Named var _name as String? pro name as String get return _name ? '' set _name = value class A adds Named pass class B adds Values pass class C adds Named, Values pass class P def main a = A() assert a inherits Named # .no-warnings. assert a.name == '' a.name = 'a' assert a.name == 'a' .checkNamed(a) b = B() assert b inherits Values # .no-warnings. assert b.one == 1 assert b.two == 2 .checkValues(b) c = C() assert c inherits Named # .no-warnings. assert c inherits Values # .no-warnings. assert c.one == 1 assert c.two == 2 assert c.name == '' c.name = 'foo' assert c.name == 'foo' .checkNamed(c) .checkValues(c) def checkNamed(n as Named) n.name = 'foo' assert n.name == 'foo' def checkValues(v as Values) assert v.one == 1 assert v.two == 2 assert v.sum == 3 v.moreLocalVarTesting