# This was reported as a bug ("Internal compiler error") for Boo. # Just checking that it works in Cobra. (It did first time.) use System.Collections.ObjectModel class Item var _key as String var _value as String cue init(key as String, value as String) base.init _key = key _value = value pro key from var pro value from var class ItemList inherits KeyedCollection def getKeyForItem(item as Item?) as String is protected, override return item.key class Test def main is shared list = ItemList() list.add(Item('foo Key', 'foo Value')) list.add(Item('bar Key', 'bar Value')) assert list['foo Key'].value == 'foo Value'