www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17954] New: init member should be disallowed

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

          Issue ID: 17954
           Summary: init member should be disallowed
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

Now that Phobos and DMD do not have any types that define an init member of any
kind (TypeInfo.init was the only culprit), we should disallow defining members
with the name init. This allows generic code to correctly assume that T.init
will be the exact default initializer instance of a type.

I propose that in the next compiler release (at time of this writing, that
would be 2.078) defining an init member should be a deprecation warning. Then
at the next compiler release, it is an error.

--
Oct 30 2017