- Code: Select all
class X
def main
a = 'aoeu' to Object
b = 5 to Object
l = [a to String, b to int]
x = l[0]
y = l[1]
assert x.length == 4
assert y * 2 == 10
Fails with
- Code: Select all
castInList.cobra(8): error: Cannot find a definition for "length" in "x" whose
type is "Object".
castInList.cobra(9): error: Cannot apply STAR to Object and int. Try finding a
method that performs this function.
Compilation failed - 2 errors, 0 warnings
from ( l is a List<Of Object>) and so become x and y
Should it ??