www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22419] New: Allow return type inference for main


          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 puremagic.com
          Reporter: moonlightsentinel disroot.org

`auto main()` is currently rejected by the compiler even if the right return
(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`.

Oct 18 2021