mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We have a predicate in ClassDecl, 'inheritsSuperclassInitializers', that is used in a few places to decide if we need to do lookups into a superclass to find all relevant initializers. That's useful, but the actual work being computed in that function is almost identical to the work done in figuring out whether the class has provided all its superclass's /required/ initializers, which is part of the type checker operation 'resolveImplicitConstructors'. Furthermore, 'inheritsSuperclassInitializers' is /already/ calling 'resolveImplicitConstructors' because those implicit constructors might affect the result. Simplify this whole mess and prevent further inconsistencies like the previous commit by just making 'resolveImplicitConstructors' decide whether superclass convenience initializers are inherited. It does make that function more complicated, but with the benefit of not having duplication anymore. No intended user-visible change, except that this bit is now serialized instead of being recomputed, which means the module format changed.
49 KiB
49 KiB