mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, for an Objective-C class method declaration that could be imported as init, we were making 4 decls: 1) The Swift 2 init 2) The Swift 2 class method decl (suppressing init formation) 3) The Swift 3 init (omitting needless words) 4) The Swift 3 class method decl (suppressing init formation and omitting needless words) Decls 1), 2), and 4) exist for diagnostics and redirect the user at 3). But, 4) does not correspond to any actual Swift version name and producing it correctly would require the user to understand how omit-needless-words and other importer magic operates. It provides very limited value and more importantly gets in the way of future Clang importer refactoring. We’d like to turn Decl importing into something that is simpler and language-version parameterized, but there is no real Swift version to correspond to decl 4). Therefore we will be making the following decls: 1) The "raw" decl, the name as it would appear to the user if they copy-pasted Objective-C code 2) The name as it appeared in Swift 2 (which could be an init) 3) The name as it appeared in Swift 3 (which could be an init and omit needless words) This aligns with the language versions we want to import as in the future: raw, swift2, swift3, …, and current. Note that swift-ide-test prunes decls that are unavailable in the current Swift version, so the Swift 2 non-init decls are not printed out, though they are still present. Tests were updated and expanded to ensure this was still the case.
2.2 KiB
2.2 KiB