# inherit a generic type with one close arg and one generic arg class Stuff inherits Dictionary def have(name as String) as bool return .containsKey(name) class Color var _rgbSpec as String cue init(rgbSpec as String) base.init _rgbSpec = rgbSpec get rgbSpec from var class Test def main is shared numbers = Stuff() assert not numbers.have('one') numbers['one'] = 1 assert numbers.have('one') i = numbers['one'] # type inference assert i == 1 colors = Stuff() assert not numbers.have('red') colors['red'] = Color('f00') assert colors.have('red') assert not colors.have('blue') c = colors['red'] # type inference assert c.rgbSpec == 'f00' for item in colors key = item.key # prove that inferred type is String assert key.length key = 'aoeu' value = item.value # prove that inferred type is Color assert value.rgbSpec == 'f00' value = Color('0f0')