Changes between Initial Version and Version 1 of Ticket #304


Ignore:
Timestamp:
Mar 4, 2025, 2:03:56 PM (7 months ago)
Author:
mlbrooks
Comment:

Simplified the workaround considerably and added cause-effect discussion.

Reduced priority, given ease to work around.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #304

    • Property Priority majorminor
  • Ticket #304 – Description

    initial v1  
    2222Note the field `b` is being emitted correctly
    2323
    24 The following convoluted sequence of declarations gives a workaround:
     24Either 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
     26Working theory: the compile unit's first reference to a type cannot be a self reference.
    2527
    2628{{{
    27     struct nothing {};
    2829    forall( tE & ) {
    29         struct nothing_poly {};
    3030        struct thing;
    31         extern "C" {
    32             nothing xx(nothing_poly(tE)*);  // never defined
    33             foo(thing(tE)) * not_a_literal();  // never defined
    34         }
     31        struct workaround_t {
     32            thing(tE) * x;
     33        };
     34        void * workaround( thing(tE) * );  // never defined
    3535        struct thing{
    36             typeof(xx(not_a_literal())) shouldBeHarmless;
    3736            thing(tE) *a;
    3837            thing(tE) *b;