""" The `dynamic` type crossed with expressions. For boolean and arithmetic operators, see dynamic-ops.cobra. """ class A get foo as String return 'foo' class E inherits Exception pass class Test def main Test().run def run x as dynamic = 1 xq as dynamic? y as dynamic = 2 yq as dynamic? # in assert 'b' in 'abc' x = 'abc' assert 'b' in x x = 'b' assert x in 'abc' y = 'abc' assert x in y xq = 'abc' assert 'b' in xq xq = 'b' assert xq in 'abc' yq = 'abc' assert xq in yq # TODO: repeat above for list, array and dict # if x = 5 y = 6 assert if(x>y, x, y) == 6 assert if(xy, x, 0) assert z1 == 0 z1 = 'aoeu' # z1 should be dynamic z2 = if(xyq, xq, yq) == 6 assert if(xqyq, xq, 0) assert z3 == 0 z3 = 'aoeu' # z3 should be dynamic z4 = if(xq