www.digitalmars.com         C & C++   DMDScript  

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

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

          Issue ID: 21564
           Summary: Allow assignment syntax for instantiating mixin
                    templates
           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
syntax:

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:

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

--
Jan 20 2021