Skip to content

Commit ea49d13

Browse files
CodaFiRobert Widmann
authored andcommitted
Availability
1 parent 6da3333 commit ea49d13

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lib/AST/ASTDemangler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,12 @@ ModuleDecl *
10321032
ASTBuilder::findModule(NodePointer node) {
10331033
assert(node->getKind() == Demangle::Node::Kind::Module);
10341034
const auto moduleName = node->getText();
1035+
// Respect the main module's ABI name when we're trying to resolve
1036+
// mangled names. But don't touch anything under the Swift stdlib's
1037+
// umbrella.
10351038
if (Ctx.MainModule && Ctx.MainModule->getABIName().is(moduleName))
1036-
return Ctx.MainModule;
1039+
if (!Ctx.MainModule->getABIName().is(STDLIB_NAME))
1040+
return Ctx.MainModule;
10371041

10381042
return Ctx.getModuleByName(moduleName);
10391043
}

test/ModuleInterface/Inputs/opaque-type-abi-name/Bottom.swiftinterface

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33

44
import Swift
55

6+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
67
public protocol Aspect {
78
associatedtype Orientation : Bottom.Aspect
89
var orientation: Self.Orientation { get }
910
}
1011

12+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1113
public struct Parameter {
1214
}
1315

16+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1417
public struct ReferencesTop {
18+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1519
public func orientation(of parameter: Bottom.Parameter) -> some Bottom.Aspect
1620

21+
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
1722
public typealias Orientation = @_opaqueReturnTypeOf("$s3Top13ReferencesTopV11orientation2ofQrAA9ParameterV_tF", 0) __
1823
}

test/ModuleInterface/Inputs/opaque-type-abi-name/test.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)