Changes between Initial Version and Version 1 of Ticket #304
- Timestamp:
- Mar 4, 2025, 2:03:56 PM (7 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #304
- Property Priority major → minor
-
Ticket #304 – Description
initial v1 22 22 Note the field `b` is being emitted correctly 23 23 24 The following convoluted sequence of declarations gives a workaround: 24 Either of the following "workaround" declarations (struct or function parameter) is enough, on its own, to make `thing`'s self-reference work. The fact that a `thing(tE) *` field is valid in the workaround position suggests that self-reference is an essential part of the problem. 25 26 Working theory: the compile unit's first reference to a type cannot be a self reference. 25 27 26 28 {{{ 27 struct nothing {};28 29 forall( tE & ) { 29 struct nothing_poly {};30 30 struct thing; 31 extern "C"{32 nothing xx(nothing_poly(tE)*); // never defined33 foo(thing(tE)) * not_a_literal(); // never defined34 }31 struct workaround_t { 32 thing(tE) * x; 33 }; 34 void * workaround( thing(tE) * ); // never defined 35 35 struct thing{ 36 typeof(xx(not_a_literal())) shouldBeHarmless;37 36 thing(tE) *a; 38 37 thing(tE) *b;