Last change
on this file since 011c29e was
fd54fef,
checked in by Michael Brooks <mlbrooks@…>, 4 years ago
|
Converting the project to use the new syntax for otype, dtype and ttytpe.
Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.
|
-
Property mode set to
100644
|
File size:
725 bytes
|
Rev | Line | |
---|
[afe2939] | 1 | // Create monomorphic instances of polymorphic types at global scope. |
---|
[74cfafb2] | 2 | |
---|
[fd54fef] | 3 | forall(T &) |
---|
[74cfafb2] | 4 | void poly0(T &) {} |
---|
| 5 | |
---|
[fd54fef] | 6 | forall(T & | sized(T)) |
---|
[74cfafb2] | 7 | void poly1(T &) {} |
---|
| 8 | |
---|
[fd54fef] | 9 | forall(T) |
---|
[74cfafb2] | 10 | void poly2(T &) {} |
---|
| 11 | |
---|
| 12 | struct wrapper { |
---|
| 13 | void (*mono)(int &); |
---|
| 14 | }; |
---|
| 15 | |
---|
| 16 | /* These are failing (#193): |
---|
| 17 | void (*mono0)(int &) = poly0; |
---|
| 18 | void (*mono1)(int &) = poly1; |
---|
| 19 | void (*mono2)(int &) = poly2; |
---|
| 20 | struct wrapper mono0w = { poly0 }; |
---|
| 21 | struct wrapper mono1w = { poly1 }; |
---|
| 22 | struct wrapper mono2w = { poly2 }; |
---|
| 23 | */ |
---|
| 24 | void (*mono0c)(int &) @= poly0; |
---|
| 25 | void (*mono1c)(int &) @= poly1; |
---|
| 26 | void (*mono2c)(int &) @= poly2; |
---|
| 27 | struct wrapper mono0wc @= { poly0 }; |
---|
| 28 | struct wrapper mono1wc @= { poly1 }; |
---|
| 29 | struct wrapper mono2wc @= { poly2 }; |
---|
| 30 | |
---|
| 31 | int main(void) { |
---|
| 32 | printf("Compilation Successful.\n"); |
---|
| 33 | return 0; |
---|
| 34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.