Here's a new one:
#import <flx.flxh>
typeclass Show2[T] {
virtual fun str2: T -> string;
virtual fun repr2 (t:T) : string => str2 t;
}
instance Show2[bool] {
fun str2 (x:bool) => "foo";
}
open Show2[bool];
print $ "repr: " + (repr2 true); endl;
Errors out with:
> ./flx -I. --force --inline=0 foo2.flx
CLIENT ERROR
Virtual call of 5115 dispatches to 5130
In foo2.flx: line 5, cols 11 to 45
4: virtual fun str2: T -> string;
5: virtual fun repr2 (t:T) : string => str2 t;
***********************************
6: }
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language