mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
- Deinitializers never get a custom Objective-C name.
- Classes and protocols are never bridged themselves; that only matters
for structs and enums.
This avoids another circularity issue like the one in a8bc132565,
where the Clang importer ends up importing a class and hands it to the
type checker, which then asks about conformances. The conformance
lookup table goes to add the extension from the Swift module, except
that the Swift module is what asked for the import in the first place.
It's possible there's a more general solution here, but this
particular change is good even in the non-crashy cases, and definitely
safe for Swift 4.0. Even if the test case is even more idiosyncratic
than the last one.
The test case change for SourceKit is probably due to the first
category not triggering the import of the other two
categories. Changes in import order have been known to affect source
compatibility, though not frequently. However, categories are not
intended to be ordered in the first place. There's still more we can
do in this space, and implicitly depending on these calls /outside/ of
the importer to control category import order was quite brittle
anyway.
SR-5330 / rdar://problem/32677610
28 lines
606 B
Swift
28 lines
606 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -o %t %s -I %S/Inputs/sr5330/ -module-name TEST
|
|
// RUN: echo 'import TEST; x' | not %target-swift-frontend -typecheck - -I %S/Inputs/sr5330/ -I %t
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import ObjCPart
|
|
|
|
public typealias Alias = MyCollection
|
|
|
|
extension Alias: Collection {
|
|
public subscript(index: Int) -> Any {
|
|
return object(at: index)
|
|
}
|
|
|
|
public func index(after i: Int) -> Int {
|
|
return i + 1
|
|
}
|
|
|
|
public var startIndex: Int {
|
|
return 0
|
|
}
|
|
|
|
public var endIndex: Int {
|
|
return count
|
|
}
|
|
}
|