Comment #0 by moonlightsentinel — 2021-10-18T14:02:02Z
`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`.
Comment #1 by dlang-bot — 2021-10-19T09:33:22Z
dlang/dmd pull request #13195 "Fix 22419 - Allow inferred return type for main" was merged into master:
- 8db36eadfcd72a30e4968f1d068f423cc96c190d by MoonlightSentinel:
Fix 22419 - Allow inferred return type for main
`auto main()` is fine iff return type inference resolves `auto` to one
of the allowed return types (`void`, `int`, `noreturn`). Deferring the
check after the return type inference removes this arbitrary limitation
and allows for more flexible code.
E.g. to use the upcoming `noreturn` inference and the associated
codegen improvements.
https://github.com/dlang/dmd/pull/13195