mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Swift 4.x (x < 2) names are obsoleted in 4.2, not 5.
In APINotes, when an unversioned name overrides a previously declared name with a Swift version, if the previously declared name is guarded under version 4 the obsoleted version should be 4.2, not 5. In all other cases, the obsoleted version is the next major Swift version. Fixes rdar://problem/39950937
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
Name: M
|
||||
Classes:
|
||||
- Name: FooID
|
||||
SwiftName: Foo_ID
|
||||
|
||||
SwiftVersions:
|
||||
- Version: 4
|
||||
Classes:
|
||||
- Name: FooID
|
||||
SwiftName: FooID
|
||||
@@ -0,0 +1,3 @@
|
||||
@import Foundation;
|
||||
@interface FooID: NSObject
|
||||
@end
|
||||
@@ -1,3 +1,6 @@
|
||||
module APINotesTest {
|
||||
header "APINotesTest.h"
|
||||
}
|
||||
module ObsoletedAPINotesTest {
|
||||
header "ObsoletedAPINotesTest.h"
|
||||
}
|
||||
|
||||
7
test/APINotes/obsoleted.swift
Normal file
7
test/APINotes/obsoleted.swift
Normal file
@@ -0,0 +1,7 @@
|
||||
// RUN: not %target-swift-frontend -typecheck -verify -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks -swift-version 3 %s
|
||||
// RUN: %target-swift-frontend -typecheck -verify -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks -swift-version 4.2 %s
|
||||
// RUN: %target-swift-frontend -typecheck -verify -I %S/Inputs/custom-modules -F %S/Inputs/custom-frameworks -swift-version 5 %s
|
||||
import ObsoletedAPINotesTest
|
||||
|
||||
let _: FooID // expected-error{{'FooID' has been renamed to 'Foo_ID'}}
|
||||
let _: Foo_ID
|
||||
Reference in New Issue
Block a user