Skip to content

fix -typecheck -verify and experimental features #68711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kavon
Copy link
Member

@kavon kavon commented Sep 22, 2023

When using -enable-experimental-feature on a non-asserts build, we only emit an error diagnostic that has no source-line information and continue to enable the feature.

That doesn't actually prevent use of the experimental feature when you are passing -typecheck -verify, since in diagnostics verification mode, a diagnostic with an unknown error location is ignored. Thus, the experimental feature is enabled and run for type-checking, but the compiler would exit with a zero error code.

This patch takes a hammer to that escape-hatch, forcing an early non-zero exit the moment an experimental feature is requested. The error message is output to stderr so that CI and other tools should see what happened.

When using `-enable-experimental-feature` on a non-asserts build,
we only emit an error diagnostic that has no source-line information
and continue to enable the feature.

That doesn't actually prevent use of the experimental feature when
you are passing `-typecheck -verify`, since in diagnostics verification
mode, a diagnostic with an unknown error location is ignored. Thus,
the experimental feature is enabled and run for type-checking, but
the compiler would exit with a zero error code.

This patch takes a hammer to that escape-hatch, forcing an early
non-zero exit the moment an experimental feature is requested. The
error message is output to stderr so that CI and other tools should see
what happened.
@kavon
Copy link
Member Author

kavon commented Sep 22, 2023

@swift-ci please test

@kavon kavon merged commit 4b7c020 into swiftlang:main Sep 23, 2023
@kavon kavon deleted the warn-about-experimental-features-noassert branch September 23, 2023 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants