Commit Graph

4 Commits

Author SHA1 Message Date
Allan Shortlidge
2899aa5660 ModuleInterface: Add more test cases to actor_init.swift.
Resolves rdar://133012963.
2024-08-02 07:50:51 -07:00
Allan Shortlidge
403156b088 Revert "AST: Don't print convenience on actor initializers."
This reverts commit 3453b136c3.
2024-08-02 07:50:51 -07:00
Allan Shortlidge
3453b136c3 AST: Don't print convenience on actor initializers.
Although actor initializers can be classified as convenience initializers by
the internals of the compiler, they are not written that way in source and
should not be printed with the `convenience` keyword.

Resolves rdar://130926278.
2024-07-11 11:47:19 -07:00
Allan Shortlidge
7cadb0b4e3 Sema: Downgrade actor convenience initializer diagnostic to a warning 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.
2024-07-02 08:31:23 -07:00