- File:
-
- 1 edited
-
tests/tuple/tuplePolymorphism.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/tuple/tuplePolymorphism.cfa
rfd54fef r107b01a 29 29 // ensure that f is a viable candidate for g, even though its parameter structure does not exactly match 30 30 [A] f([A, B] x, B y) { printf("%g %c %g %lld %c %lld %lld %c %lld\n", x.0.[x,y,z], x.1.[x,y,z], y.[x,y,z]); return x.0; } 31 forall( T,U | { T f(T, U, U); })31 forall(otype T, otype U | { T f(T, U, U); }) 32 32 void g(T x, U y) { f(x, y, y); } 33 33 34 34 // add two triples 35 forall( T | { T ?+?(T, T); })35 forall(otype T | { T ?+?(T, T); }) 36 36 [T, T, T] ?+?([T, T, T] x, [T, T, T] y) { 37 37 return [x.0+y.0, x.1+y.1, x.2+y.2]; … … 64 64 } 65 65 66 forall( T)66 forall(otype T) 67 67 [T, T] foo([T, T] y) { 68 68 [T, T] x;
Note:
See TracChangeset
for help on using the changeset viewer.