www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20305] New: String mixins fail for structs with 'alias this'


          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 puremagic.com
          Reporter: maxsamukha 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


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

Oct 17 2019