Changeset dafbde8 for tests/tuple
 Timestamp:
 Jan 20, 2021, 4:49:40 PM (12 months ago)
 Branches:
 armeh, jacob/cs343translation, master, newastuniqueexpr
 Children:
 454f478
 Parents:
 92bfda0 (diff), fd54fef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent.  Location:
 tests/tuple
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

tests/tuple/tuplePolymorphism.cfa
r92bfda0 rdafbde8 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( otype T, otypeU  { T f(T, U, U); })31 forall(T, 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( otypeT  { T ?+?(T, T); })35 forall(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( otypeT)66 forall(T) 67 67 [T, T] foo([T, T] y) { 68 68 [T, T] x; 
tests/tuple/tupleVariadic.cfa
r92bfda0 rdafbde8 19 19 printf("called func(void)\n"); 20 20 } 21 forall( otype T, ttype Params { void process(T); void func(Params); })21 forall(T, Params...  { void process(T); void func(Params); }) 22 22 void func(T arg1, Params p) { 23 23 process(arg1); … … 92 92 } 93 93 94 forall( otypeT)94 forall(T) 95 95 T * copy(T x) { 96 96 // test calling new inside a polymorphic function … … 98 98 } 99 99 100 forall( ttype T { void foo(T); }) void bar(T x) {}100 forall(T...  { void foo(T); }) void bar(T x) {} 101 101 void foo(int) {} 102 102
Note: See TracChangeset
for help on using the changeset viewer.