www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21564] New: Allow assignment syntax for instantiating mixin


          Issue ID: 21564
           Summary: Allow assignment syntax for instantiating mixin
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: qs.il.paperinik gmail.com

Currently, a mixin template instance can be aliased akin to the old alias

mixin M!params m; // m is an alias to M!params

It would be desirable to also allow the assignment syntax:

mixin m = M!params;

Grammar changes:

    mixin MixinTemplateName TemplateArguments[opt] Identifier[opt] ;
+   mixin Identifier = MixinTemplateName TemplateArguments[opt] ;

Jan 20 2021