mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This allows a previously-working case of Objective-C forward-declaring a type in a /different/ Swift module to continue working, as long as the Swift context being compiled manages to import the other module properly (including its generated header). This isn't really our recommended pattern---that would be to @import the module in the bridging header and forego the forward declaration---but it doesn't cost much to keep it working. It's also a place where textual and precompiled bridging headers behaved differently, because precompiled ones are processed much earlier. https://bugs.swift.org/browse/SR-3798
41 lines
745 B
Swift
41 lines
745 B
Swift
@objc public class BaseClass {}
|
|
|
|
public func getBaseClass() -> BaseClass {
|
|
return BaseClass()
|
|
}
|
|
|
|
public func useBaseClass(_: BaseClass) {}
|
|
|
|
@objc public
|
|
protocol BaseProto {}
|
|
|
|
public func useBaseProto(_: BaseProto) {}
|
|
|
|
extension BaseClass {
|
|
public func extensionMethod() {}
|
|
}
|
|
|
|
@objc public enum BaseEnum: CShort {
|
|
case Zim
|
|
case Zang
|
|
case Zung
|
|
}
|
|
|
|
@objc(RenamedEnum) public enum SwiftEnum: CShort {
|
|
case Quux
|
|
case Corge
|
|
case Grault
|
|
}
|
|
|
|
@objc public class AnotherClass {
|
|
@objc public func getEnum() -> BaseEnum { return .Zung }
|
|
@objc public func getSwiftEnum() -> SwiftEnum { return .Quux }
|
|
public init() {}
|
|
}
|
|
|
|
@objc(RenamedClass) public class SwiftClass {}
|
|
|
|
public func getSwiftClass() -> SwiftClass {
|
|
return SwiftClass()
|
|
}
|