mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Christopher Rogers' (good) work in 49fd5acbb2 caught places where
the Swift compiler was allowing a @class to resolve to a Swift class
even if that class had a conflicting Objective-C name, or wasn't
intended to be exposed to Objective-C at all. Unfortunately, this
broke source compatibility in projects where people were relying on
this. Restore that functionality, but only as a fallback; matching the
Objective-C name is better than matching the Swift name.
rdar://problem/56681046
14 lines
441 B
Swift
14 lines
441 B
Swift
// RUN: %target-swift-frontend -import-objc-header %S/Inputs/import-as-member-swift.h -typecheck -enable-objc-interop -disable-objc-attr-requires-foundation-module %s
|
|
|
|
@objc internal class Outer {}
|
|
|
|
@objc(OuterByObjCName_ObjC)
|
|
internal class OuterByObjCName_Swift {}
|
|
|
|
@objc(OuterBySwiftName_ObjC)
|
|
internal class OuterBySwiftName_Swift {}
|
|
|
|
_ = Outer.Nested(a: 1)
|
|
_ = OuterByObjCName_Swift.Nested(b: 2)
|
|
_ = OuterBySwiftName_Swift.Nested(c: 3)
|