Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/polymorphism.cfa

    rfd54fef rf498c51  
    1818#include <fstream.hfa>
    1919
    20 forall(T)
     20forall(otype T)
    2121T f(T x, T y) {
    2222        x = y;
     
    2424}
    2525
    26 forall(T) T ident(T x) {
     26forall(otype T) T ident(T x) {
    2727        return x;
    2828}
    2929
    30 forall( T, U )
     30forall( otype T, otype U )
    3131size_t struct_size( T i, U j ) {
    3232        struct S { T i; U j; };
     
    3434}
    3535
    36 forall( T, U )
     36forall( otype T, otype U )
    3737size_t union_size( T i, U j ) {
    3838        union B { T i; U j; };
     
    4141
    4242// perform some simple operations on aggregates of T and U
    43 forall( T | { void print(T); int ?==?(T, T); }, U | { void print(U); U ?=?(U&, zero_t); } )
     43forall( otype T | { void print(T); int ?==?(T, T); }, otype U | { void print(U); U ?=?(U&, zero_t); } )
    4444U foo(T i, U j) {
    4545        struct S { T i; U j; };
Note: See TracChangeset for help on using the changeset viewer.