1: #line 1790 "./lpsrc/flx_regress.pak"
2:
3:
4: proc pr[t]:t="std::cout<<$1<<std::endl;" requires iostream;
5:
6: typeclass XEq[t,u] {
7: virtual fun xeq: t * u -> 2;
8: virtual proc ppp: t;
9: }
10:
11: instance XEq[int,int] {
12: fun xeq: int * int -> 2 = "$1==$2";
13: proc ppp (x:int) { pr x; }
14: fun fred: int -> int = "";
15: }
16:
17:
18: instance XEq[long,int] {
19: fun xeq: long * int -> 2 = "$1==$2";
20: proc ppp (x:long) { pr x; }
21: }
22:
23: fun jeq[r,s with XEq[r,s]] (x:r,y:s)=> xeq(x,y);
24: fun keq[t with XEq[t,t]] (x:t,y:t)=> jeq(x,y);
25: fun peq[t with XEq[t,t]] (x:t,y:t)=> keq(x,y);
26: proc zzz[t with XEq[t,t]] (x:t) { ppp x; }
27:
28: pr$ peq$ 1,2;
29: pr$ peq$ 1,1;
30:
31: zzz 1;