[Issue 24730] New: Cannot initialize ref variable through `alias this`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 28 18:18:40 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24730

          Issue ID: 24730
           Summary: Cannot initialize ref variable through `alias this`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

struct S {}
struct S2
{
    S s;
    alias this = s;
}

void main()
{
    S2 s2;
    ref S s = s2;
}

a.d(14): Error: type `S2` cannot be assigned to `ref S s`

--


More information about the Digitalmars-d-bugs mailing list