Encountered by F Geiger (
http://groups.google.com/group/boolang/browse_thread/thread/2d0fd0beeb0d5671/a4e22c3bd8371cd1#a4e22c3bd8371cd1
)
rwar1 has an indexer.
rwar2 derives from rwar1 and thus inherits rwar1's indexer.
However, if source code using rwar2 is visited before information about rwar2 and rwar1 has been collected, then Boo doesn't know that rwar2 has inherited an indexer from rwar1. This results in incorrect compiler errors.
RWAR1.BOO
class rwar1:
"""Description of rwar1"""
def constructor():
pass
self[i as int]:
get:
return 0
set:
pass
RWAR2.BOO
class rwar2(rwar1):
"""Description of rwar2"""
def constructor():
pass
RWARTEST.BOO
class rwartest:
"""Description of rwartest"""
def constructor():
pass
y = rwar2()
y[0]
CONSOLE COMMANDS USED – note the order i pass in files seems to be the order boo visits classes***
D:\Boo\boo\trunk\bin\net-2.0>booc -r:mapack -r:boo.lang.useful -t:library d:\temp\strangething\rwartest.boo d:\temp\StrangeThing\rwar1.boo d:\temp\StrangeThing\rwar2.boo
Boo Compiler version 0.7.6.2204 (CLR v2.0.50727.42)
d:\temp\strangething\rwartest.boo(11,1): BCE0048: Type 'StrangeThing.rwar2' does
not support slicing.
1 error(s).
D:\Boo\boo\trunk\bin\net-2.0>booc -r:mapack -r:boo.lang.useful -t:library d:\temp\StrangeThing\rwar1.boo d:\temp\StrangeThing\rwar2.boo d:\temp\strangething\rwartest.boo
Boo Compiler version 0.7.6.2204 (CLR v2.0.50727.42)
(compile worked)