[Issue 11008] Allow -main switch even if user-defined main function exists

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 31 05:10:19 UTC 2021


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

ZombineDev <petar.p.kirov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |petar.p.kirov at gmail.com
         Resolution|WONTFIX                     |---

--- Comment #6 from ZombineDev <petar.p.kirov at gmail.com> ---
I'm reopening, since it is useful to have the `-main` switch replace the
user-defined function given that the default druntime behavior is to not run
`main()` after executing unit tests, since dmd 2.090 -
https://dlang.org/changelog/2.090.0.html#unittest-default |
https://run.dlang.io/is/GzX7qt

Currently, running `dub test --single` fails if there's a user-defined main:
https://github.com/dlang/dub/issues/2122, because of this behavior.

--


More information about the Digitalmars-d-bugs mailing list