--cond Class C inherits A { d:Int; m14(f:Int):A{ if (true) then self else self fi --least bound of SELF_TYPE and SELF_TYPE is A }; }; Class A{ a:Int; b:Bool; --checking the predicate type m1(a:Int):Int{ if true then a<-1 else a<-2 fi }; m2(a:Int):Int{ if false then a<-1 else a<-2 fi }; m3(a:Bool, b:Int):Int{ if a then b<-1 else b<-2 fi }; m4(a:Int):Int{ { if (4<2) then a<-1 else a<-2 fi ; if (4<=2) then a<-1 else a<-2 fi ; if (4=2) then a<-1 else a<-2 fi ; if (not(true)) then a<-1 else a<-2 fi ; if (not(4<2)) then a<-1 else a<-2 fi ; } }; --checking the return value m5(f:Int):Object{ if (true) then (new A) else (new B) fi }; m6(f:Int):B1{ if (true) then (new B2) else (new B3) fi }; m7(f:Int):B2{ if (true) then (new B2) else (new B4) fi }; m8(f:Int):Object{ if (true) then (new B2) else 1 fi }; m9(f:Int):B4{ if (true) then (new B4).mb4() else (new B4) fi --mb4 will return B4 }; m10(f:Int):A{ if (true) then (new C) else self fi --least bound of C and SELF_TYPE is A }; m11(f:Int):A{ if (true) then self else (new C) fi --least bound of C and SELF_TYPE is A }; m12(f:Int):A{ if (true) then self else self fi --least bound of SELF_TYPE and SELF_TYPE is A }; m13(f:Int):SELF_TYPE{ if (true) then self else self fi --least bound of SELF_TYPE and SELF_TYPE is A }; }; class B{ a:Int; }; --also check for SELF_TYPE 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 }; };