Skip to content

Sema: Downgrade actor convenience initializer diagnostic to a warning in interfaces #74877

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

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Jul 1, 2024

The convenience keyword is not accepted on actor initializers because the compiler infers this status automatically and actors cannot be subclassed. However, internally the compiler still computes whether an actor init is a convenience init and this implicit status has been leaking through accidentally in printed .swiftinterface files. This was noticed because in Swift 6 the presence of the keyword is diagnosed as an error, making .swiftinterface files unparseable for modules containing actors with convenience inits.

For Swift 6, I'm just going to suppress the error in .swiftinterface files regardless of language mode. In future releases of the compiler, though, it can stop printing the convenience keyword on these inits altogether.

Resolves rdar://130857256.

@tshortli tshortli requested a review from kavon July 1, 2024 23:16
@tshortli
Copy link
Contributor Author

tshortli commented Jul 1, 2024

@swift-ci please smoke test

… in interfaces.

The `convenience` keyword is not accepted on actor initializers because the
compiler infers this status automatically and actors cannot be subclassed.
However, internally the compiler still computes whether an actor init is a
convenience init and this implicit status has been leaking through accidentally
in printed `.swiftinterface` files. This was noticed because in Swift 6 the
presence of the keyword is diagnosed as an error, making `.swiftinterface`
files unparseable for modules containing actors with convenience inits.

For Swift 6, I'm just going to suppress the error in `.swiftinterface` files
regardless of language mode. In future releases of the compiler, though, it can
stop printing the `convenience` keyword on these inits altogether, though.

Resolves rdar://130857256.
@tshortli tshortli force-pushed the module-interface-suppress-actor-convenience-init-diag branch from 8e4929b to 7cadb0b Compare July 2, 2024 15:31
@tshortli
Copy link
Contributor Author

tshortli commented Jul 2, 2024

@swift-ci please smoke test

@tshortli tshortli merged commit 6d088fc into swiftlang:main Jul 2, 2024
3 checks passed
@tshortli tshortli deleted the module-interface-suppress-actor-convenience-init-diag branch July 2, 2024 19:54
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