[Issue 24821] New: Can't return void from constructors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 18 10:38:47 UTC 2024


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

          Issue ID: 24821
           Summary: Can't return void from constructors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

void foo();

class A
{
    this() => foo(); // fail
}

Error: cannot return expression from constructor

--


More information about the Digitalmars-d-bugs mailing list