--case Class A { a:Int; w:Undef; q:Int; --check for scopes g():Object { case a of b:Int => b<- b+1; c:String => b<-"Hello"; --b is no more alive d:A => b<-self; --b is no more alive esac }; --check for type compatibility and undefined types f():Object { case a of --***********************Looking here b:Undef => b<- b+1; b:Undef => b<- b+1; c:String => c<-1; d:C => d<-self; esac }; --check for repeated types e():Object { case a of b:String => b<- "Hello"; c:String => c<-1; d:A => d<-self; esac }; --check for incorrect expressions d():Object { case a of b:String => t<- "Hello"; c:String => q<-1; d:A => d<-self; esac }; --check for least ret types h():B { --ret type will be A, least type of C, B, A case self of b:C => b<-(new C) ; b:B => b<- (new B); b:A => b<- (new A); esac }; n():B{ q<-m() }; --check for least ret types in case of undefined types m():B { q <- case self of b:B => b<- (new B); b:C => b<-w; b:B => b<-w; -- b:A => b<- (new A); esac }; --check for SELF_TYPE i():B { --ret type will be A, least type of C, B, A case (new A) of b:C => self ; b:B => b<- (new B); esac }; --check for SELF_TYPE j():B { --ret type will be A, least type of C, B, A case (new A) of b:B => b<- (new B); b:C => self ; esac }; --check for SELF_TYPE k():B { --ret type will be A, least type of C, B, A case (new A) of b:B => (new B).mb(); b:C => self ; esac }; }; Class B inherits A { b:Int; mb():SELF_TYPE{ self }; }; Class C inherits B { c:Int; }; Class Main{ main():Int{ 1 }; };