[Issue 20305] New: String mixins fail for structs with 'alias this'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 17 18:04:21 UTC 2019


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

          Issue ID: 20305
           Summary: String mixins fail for structs with 'alias this'
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

struct S {
    string s = "{}"; 
        alias s this;
}

void main() {
    static assert(S() == "{}"); //ok
    mixin(S()); // fail
}


onlineapp.d-mixin-8(8): Error: found End of File when expecting ; following
statement

https://run.dlang.io/is/r9gRMm


The spec vaguely states that the string mixin arguments "must be representable
as a string". "representable" should be specified.

--


More information about the Digitalmars-d-bugs mailing list