[Issue 23260] New: If constructors have a function body, they should infer attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 20 19:32:31 UTC 2022


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 at puremagic.com
          Reporter: bugzilla at digitalmars.com

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

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

--


More information about the Digitalmars-d-bugs mailing list