Files
swift-mirror/test/ClangImporter/MixedSource/import-as-member-swift.swift
Jordan Rose b00bc829f8 [ClangImporter] Fall back to Swift class names when resolving @class (#27921)
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
2019-10-29 09:50:49 -07:00

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)