mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This patch is an add-on to https://github.com/apple/swift/pull/64043. Essentially when encountering NS_OPTIONS enums, in C++-Interop mode if they are not specially handled then they can mangle differently than they do without C++-Interop. This patch adds logic to handle when a typedef and enum have additional clang::ElaboratedType sugar, but otherwise it does the same as the existing 64043 patch. The test case provided was encountered in a real app build. The problem came from when two modules are each compiled one with and one without C++-Interop. For the test case code provided the mangling of the protocol conformance is not consistent and the code in SILGenLazyConformance.cpp crashes on an invalid conformance with reason "Invalid conformance in type-checked AST".
12 lines
501 B
Swift
12 lines
501 B
Swift
// RUN: %target-swift-frontend -I %S/Inputs -c -cxx-interoperability-mode=swift-5.9 %s -S -o - | %FileCheck %s
|
|
// RUN: %target-swift-frontend -I %S/Inputs -c %s -S -o - | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
// CHECK: _$sSo14UIControlStateV4main7FooableACMc
|
|
// The following check is to ensure the conformance is mangled properly:
|
|
// protocol conformance descriptor for __C.UIControlState : main.Fooable in main
|
|
import NSOptionsMangling
|
|
protocol Fooable { }
|
|
extension UIControl.State: Fooable {}
|