mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Swift generates implicit constructors for inherited designated initializers in case some implicit initialization (such as running property initializer expressions) needs to run after calling the initializer on the superclass. These implicit initializers are printed in .swiftinterfaces and previously they could cause the interface to fail to typecheck when one of the parameters is declared to be unavailable-in-Swift. These initializers need to be generated because they may be called from Objective-C where the unavailable-in-Swift designation is irrelevant. To account for this possibility, relax availability checking to allow this narrow exception only in .swiftinterfaces. Another possible but more complicated solution would be to print the initializers with an attribute that indicates that the initializer is inherited and implicit. This would allow the typechecking exception to be more precise but seems unnecessarily complicated given that the exception is only needed in .swiftinterfaces, which are already compiler generated. Resolves rdar://77221357