source: src/Tests/SynTree/TypeGenerator.c @ 0b2961f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 0b2961f was 0b2961f, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

fix warnings from prelude.cf, work on regression testing

  • Property mode set to 100644
File size: 853 bytes
Line 
1context addable(type T) {
2        T ?+?(T,T);
3};
4
5type List(type T | addable(T) ) | addable(T) = struct { T data; List(T) *next; } *;
6typedef List(int) ListOfIntegers;
7ListOfIntegers li;
8int f( List(int) ((*g))(int) );
9[int] h( * List(int) p ); // new declaration syntax
10
11struct(type T) S1;                      // forward definition
12struct(type T) S1 { T i; };             // actual definition
13struct(int) S1 v1, *p;                  // expansion and instantiation
14struct(type T)(int) S2 { T i; } v2;     // actual definition, expansion and instantiation
15struct(type T)(int) { T i; } v2;        // anonymous actual definition, expansion and instantiation
16
17struct( type T | addable(T) ) node { T data; struct(T) node *next; };
18type List(type T) = struct(T) node *;
19List(int) my_list;
20
21type Complex | addable(Complex);
22
23int main() {
24        (struct(int) node)my_list;
25}
26
27// Local Variables: //
28// tab-width: 4 //
29// End: //
Note: See TracBrowser for help on using the repository browser.