interface IFoo get x as int class Bar implements IFoo get x as int return 5 class Test def main is shared o as Object = Bar() f as IFoo = Bar() f = o to IFoo # the test: cast to an interface assert f.x==5