class Test def main is shared # index a dynamic receiver x as dynamic = A() assert x[2] == 4 assert x[3] == 6 x = B() x[1] = 3 assert x[1] == 3 x[3] = 2 assert x[3] == 2 # index a static receiver with dynamic args # TODO: IndexerExp.bindImp needs enhancement a = A() x = 5 assert a[x] == 10 b = B() x = 2 y as dynamic = 4 b[x] = y assert b[x] == y assert b[x] == 4 assert b[2] == y assert b[2] == 4 # TODO: Indexing a dynamic receiver with dynamic args. # TODO: multiple args # TODO: overloaded indexers class A get [i as int] as int return i*2 class B var _values = Dictionary() pro [i as int] as int get return _values[i] set _values[i] = value