www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23260] New: If constructors have a function body, they should

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

          Issue ID: 23260
           Summary: If constructors have a function body, they should
                    infer attributes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

struct S { int a; this(int a) { } }

 safe test()
{
    S s = S(1);  // ctor attribute inference will let this compile
}

--
Jul 20 2022