[Issue 22419] New: Allow return type inference for main

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 18 14:02:02 UTC 2021


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

          Issue ID: 22419
           Summary: Allow return type inference for main
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

`auto main()` is currently rejected by the compiler even if the right return
type
(int/void/noreturn) can be inferred from the function body.

But return type inference allows for more flexibility and potentially better
codegen for `void` vs. `noreturn`.

--


More information about the Digitalmars-d-bugs mailing list