-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an option to not emit unionsplit fallback blocks
When union splitting, we currently emit a fallback block that prints `fatal error in type inference (type bound)`. This has always been an oddity, because there are plenty of other places in the compiler that we rely on the correctness of inference, but it has caught a number of issues over the years and we do still have a few issues (e.g. #43064) that show this error. Nevertheless, the occurrence of issues like this has become less frequent, so it might be time to turn it off soon. At the same time, we have downstream users of the compiler infrastructure that get confused by having extra `throw` calls inserted into functions that (post-#43852) were inferred as `:nothrow`. Here we add an optimization param (defaulted to on) to determine whether or not to insert the unionsplit fallback block. Because of the conservative default, we can decide later what the correct default is (maybe turn it on in `debug` mode?), while letting downstream consumers play with the setting for now to see if any issues crop up.
- Loading branch information
Showing
2 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters