Open tmteam opened 3 years ago
x = if(true)
{
age = 42
name = 'vasa'
size = m
}
else
{
age = 42
}
out = x.age #ok. :int
out2 = x.name #fails, as it is not generic
------------------
f1 = rule it.age + it.size
f2 = rule it.age
f3 = if(true) f1 else f2
out1 = f4({age = 42, size = 15}) #ok, int
out2 = f3({age = 42}) #error
------------------
f1 = rule it.size
f2 = rule it.age
f3 = if(true) f1 else f2
out1 = f4({age = 42, size = 15}) #ok, int
out2 = f3({age = 42}) #error
-----------------------
arr = [{age=42}, {age = 42, size = 15}]
out1 = arr[0].age #ok, int
out2 = arr[0].size #error
-----------------------
x =
if(true) { age = 0x1 }
else { age = 42.0 }
out = x.age #ok. :real
------------------
x =
if(true) { age = 0x1 }
else if(false) { age = 'name' }
else { age = 42.0 }
out = x.age #ok. :any
------------------
x =
if(true) { age = in1 }
else if(false) { age = in2 }
else { age = in3 }
out:real = x.age #ok. :in1 == :in2 == :in3 == :real
------------------
expected: out: any actual: Runtime error. Unable to cast from Real[] to Bool