1.2.46. test/regress/rt-1.01.46

Start felix section to test/regress/rt-1.01.46-0.flx[1 /1 ]
     1: #line 1829 "./lpsrc/flx_regress.pak"
     2: //Check typeclasses
     3: #import <flx.flxh>
     4: 
     5: open List;
     6: 
     7: typeclass Str2[T] {
     8:   virtual fun str2: T->string;
     9: }
    10: 
    11: instance Str2[int] {
    12:   fun str2 (x:int): string => str x;
    13: }
    14: 
    15: fun str2[T with Str[T]] (x:list[T]):string =>
    16:   match x with
    17:   | Empty[T] => "()"
    18:   | Cons(?h, ?t) => "(" + (str2 h) + ", "  + (str2 t) + ")"
    19:   endmatch
    20: ;
    21: 
    22: fun str2[T with Str2[T]] (x:T) => str2 x;
    23: 
    24: print$ str2 5; endl;
    25: print$ str2$ list(1,2,3,4); endl;
    26: 
End felix section to test/regress/rt-1.01.46-0.flx[1]
Start data section to test/regress/rt-1.01.46-0.expect[1 /1 ]
     1: 5
     2: (1, (2, (3, (4, ()))))
End data section to test/regress/rt-1.01.46-0.expect[1]