mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The migrator only applies changes from the APIDiffMigratorPass in the primary file. This means that if a nominal type was renamed, for example, any members users have added in an extension in a separate file won't be visible, because the extension would still have the old name. This can result in 'wrong argument label' errors with fixits to change the argument labels that, when applied by the fixit pass, completely change which function was being called and cause post-migration errors. This patch updates the fixit pass to ignore diag::wrong_argument_labels. diag::extra_argument_labels and diag::missing_argument_labels were already filtered out for other reasons. Resolves rdar://problem/40170377
19 lines
861 B
Swift
19 lines
861 B
Swift
// REQUIRES: objc_interop
|
|
// RUN: %empty-directory(%t.mod) && %target-swift-frontend -emit-module -o %t.mod/Cities.swiftmodule %S/Inputs/Cities.swift -module-name Cities -parse-as-library
|
|
// RUN: %empty-directory(%t) && %target-swift-frontend -c -update-code -primary-file %s %S/Inputs/rename_cross_file_2.swift -F %S/mock-sdk -I %t.mod -api-diff-data-file %S/Inputs/API.json -emit-migrated-file-path %t/rename_cross_file.swift.result -emit-remap-file-path %t/rename_cross_file.swift.remap -o /dev/null
|
|
// RUN: diff -u %S/rename_cross_file.swift.expected %t/rename_cross_file.swift.result
|
|
|
|
import Cities
|
|
|
|
extension FontWeight {
|
|
init(x: Int, y: Int) { fatalError() }
|
|
init(x: Int, y: Int, _ z: Int) { fatalError() }
|
|
}
|
|
|
|
func foo() {
|
|
_ = FontWeight(rawValue: 1)
|
|
_ = FontWeight(string: "light")
|
|
_ = FontWeight(x: 2, y: 2, z: 2)
|
|
_ = FontWeight(x: 2, 2)
|
|
}
|