Skip to content

Conversation

tshortli
Copy link
Contributor

If a .swiftinterface file does not include an explicit -language-mode option (or its predecessor -swift-version) and needs to be built as a dependency of a client compilation, then the invocation to build the module from interface would end up inheriting the language mode that the client code is built with. This can result in spurious type checking diagnostics or even mis-compilation. To ensure that a module interface is always built using the language mode that its source code was originally built with, require an explicit -language-mode option when emitting swiftinterface files.

In #84307 this diagnostic was downgraded to a warning. The failures it caused in PR testing should now be resolved.

Resolves rdar://145168219.

If a .swiftinterface file does not include an explicit `-language-mode` option
(or its predecessor `-swift-version`) and needs to be built as a dependency of a
client compilation, then the invocation to build the module from interface
would end up inheriting the language mode that the client code is built with.
This can result in spurious type checking diagnostics or even mis-compilation.
To ensure that a module interface is always built using the language mode that
its source code was originally built with, require an explicit `-language-mode`
option when emitting swiftinterface files.

In swiftlang#84307 this diagnostic was downgraded
to a warning. The failures it caused in PR testing should now be resolved.

Resolves rdar://145168219.
@tshortli tshortli requested a review from artemcm as a code owner September 16, 2025 17:40
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli enabled auto-merge September 16, 2025 17:41
@tshortli tshortli merged commit c787253 into swiftlang:main Sep 16, 2025
3 checks passed
@tshortli tshortli deleted the really-require-swift-version-in-module-interfaces branch September 17, 2025 16:49
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.

1 participant