--cond Class C inherits A { d:Int; }; Class A{ a:Int; b:Bool; --checking the predicate type m1(a:Int):Int{ if 1 then a<-1 else a<-2 fi }; m2(a:Int):Int{ if self then a<-1 else a<-2 fi }; m3(a:Bool, b:Int):Int{ if b then b<-1 else b<-2 fi }; m4(a:Int):Int{ { if (4+2) then a<-1 else a<-2 fi ; if (a<-2) then a<-1 else a<-2 fi ; if (4*2) then a<-1 else a<-2 fi ; if (~(1)) then a<-1 else a<-2 fi ; if (~(4+2)) then a<-1 else a<-2 fi ; } }; --checking the return value m5(f:Int):A{ --invalid ret type. if (true) then (new A) else (new B) fi }; m6(f:Int):B2{ if (true) then (new B2) else (new B3) fi }; m7(f:Int):B3{ if (true) then (new B2) else (new B4) fi }; m8(f:Int):Int{ if (true) then (new B2) else 1 fi }; m9(f:Int):B2{ if (true) then (new B4).mb4() else (new B4) fi --mb4 will return B4 }; m10(f:Int):C{ if (true) then (new C) else self fi --least bound of C and SELF_TYPE is A }; m11(f:Int):C{ if (true) then self else (new C) fi --least bound of C and SELF_TYPE is A }; m12(f:Int):Int{ if (true) then self else self fi --least bound of SELF_TYPE and SELF_TYPE is A }; }; class B{ a:Int; }; class B4 inherits B2{ a:Int; mb4():SELF_TYPE { self }; }; class B3 inherits B1{ x:Int; }; class B2 inherits B1{ y:Int; }; class B1{ q:Int; }; Class Main{ main():Int{ 1 }; };