Changes in src/Tests/Attributes.c [55ba7339:68cd1ce]
- File:
-
- 1 edited
-
src/Tests/Attributes.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Tests/Attributes.c
r55ba7339 r68cd1ce 6 6 // @max 7 7 // 8 // 2. a direct application to a manifest otype8 // 2. a direct application to a manifest type 9 9 // 10 10 // @max( int ) 11 11 // 12 // 3. constraining a otype variable; the application is implicitly performed at the call site as in (2)12 // 3. constraining a type variable; the application is implicitly performed at the call site as in (2) 13 13 // 14 // forall( otype T | { T @max( T ); } ) T x( T t );14 // forall( type T | { T @max( T ); } ) T x( T t ); 15 15 // 16 16 // … … 23 23 // x = (*attr_var); 24 24 // 25 // 2. an indirect application to a manifest otype25 // 2. an indirect application to a manifest type 26 26 // 27 27 // (*attr_var)( int ) 28 28 // 29 // 3. a direct application to a otype variable29 // 3. a direct application to a type variable 30 30 // 31 31 // @max( T ) … … 47 47 // 3. polymorphic 48 48 // 49 // forall( otype T | constraint( T ) ) int @attr( T );49 // forall( type T | constraint( T ) ) int @attr( T ); 50 50 51 51 int @max = 3; … … 53 53 int main() { 54 54 int x; 55 otype @otype(otype t); // compiler intrinsic56 otype @widest(otype t);57 @ otype(x) *y; // gcc: otypeof(x) *y;58 const @widest(double) *w; // gcc: const otypeof(x) *w;59 * @ otype(3 + 4) z; // cfa declaration syntax55 type @type(type t); // compiler intrinsic 56 type @widest(type t); 57 @type(x) *y; // gcc: typeof(x) *y; 58 const @widest(double) *w; // gcc: const typeof(x) *w; 59 * @type(3 + 4) z; // cfa declaration syntax 60 60 y = @max; 61 61 z = @max(x) + @size(int);
Note:
See TracChangeset
for help on using the changeset viewer.