Skip to content

Commit 17a9eb9

Browse files
authored
Merge pull request #66574 from tshortli/revert-66516
[5.9] Revert #66516
2 parents 624f553 + 332f86c commit 17a9eb9

File tree

5 files changed

+2
-39
lines changed

5 files changed

+2
-39
lines changed

lib/AST/Decl.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,12 +3874,6 @@ getAdjustedFormalAccess(const ValueDecl *VD, const DeclContext *useDC,
38743874
}
38753875

38763876
AccessLevel ValueDecl::getEffectiveAccess() const {
3877-
// Opaque type decls inherit accessibility from their naming decl.
3878-
if (auto *opaqueType = dyn_cast<OpaqueTypeDecl>(this)) {
3879-
if (auto *namingDecl = opaqueType->getNamingDecl())
3880-
return namingDecl->getEffectiveAccess();
3881-
}
3882-
38833877
auto effectiveAccess =
38843878
getAdjustedFormalAccess(this, /*useDC=*/nullptr,
38853879
/*treatUsableFromInlineAsPublic=*/true);

test/IRGen/Inputs/AlwaysInlineIntoWithOpaque.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,3 @@ public func testInlineWithOpaque() -> some P {
1414
}
1515
return 2.0
1616
}
17-
18-
@_alwaysEmitIntoClient
19-
public func testInlineWithOpaqueUsableFromInline() -> some P {
20-
if #available(macOS 9.0, *) {
21-
return usableFromInline()
22-
}
23-
return 4.0
24-
}
25-
26-
@usableFromInline
27-
func usableFromInline() -> some P {
28-
return 3
29-
}

test/IRGen/Inputs/AlwaysInlineIntoWithOpaqueReplacement.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@ extension Int : P {
66

77
extension Double : P {
88
}
9-
10-
@usableFromInline
11-
func usableFromInline() -> some P {
12-
return 3
13-
}

test/IRGen/opaque_result_alwaysInlineIntoClient.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -parse-as-library -emit-library -emit-module-path %t/AlwaysInlineIntoWithOpaque.swiftmodule -module-name AlwaysInlineIntoWithOpaque -enable-library-evolution %S/Inputs/AlwaysInlineIntoWithOpaque.swift -o %t/%target-library-name(AlwaysInlineIntoWithOpaque)
2+
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -parse-as-library -emit-library -emit-module-path %t/AlwaysInlineIntoWithOpaque.swiftmodule -module-name AlwaysInlineIntoWithOpaque %S/Inputs/AlwaysInlineIntoWithOpaque.swift -o %t/%target-library-name(AlwaysInlineIntoWithOpaque)
33
// RUN: %target-codesign %t/%target-library-name(AlwaysInlineIntoWithOpaque)
44
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -lAlwaysInlineIntoWithOpaque -module-name main -I %t -L %t %s -o %t/a.out
55
// RUN: %target-codesign %t/a.out
66
// RUN: %target-run %t/a.out | %FileCheck %s
77

8-
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -parse-as-library -emit-library -emit-module-path %t/AlwaysInlineIntoWithOpaque.swiftmodule -module-name AlwaysInlineIntoWithOpaque -enable-library-evolution %S/Inputs/AlwaysInlineIntoWithOpaqueReplacement.swift -o %t/%target-library-name(AlwaysInlineIntoWithOpaque)
8+
// RUN: %target-build-swift -target %target-cpu-apple-macosx10.15 -parse-as-library -emit-library -emit-module-path %t/AlwaysInlineIntoWithOpaque.swiftmodule -module-name AlwaysInlineIntoWithOpaque %S/Inputs/AlwaysInlineIntoWithOpaqueReplacement.swift -o %t/%target-library-name(AlwaysInlineIntoWithOpaque)
99
// RUN: %target-codesign %t/a.out
1010
// RUN: %target-run %t/a.out | %FileCheck %s
1111

@@ -27,11 +27,3 @@ public func test() {
2727

2828
test()
2929
// CHECK: 1
30-
31-
public func testUsableFromInline() {
32-
let p = testInlineWithOpaqueUsableFromInline()
33-
print(p)
34-
}
35-
36-
testUsableFromInline()
37-
// CHECK: 3

test/TBD/opaque_result_type.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ public func dynReplacement(x: String) -> some P {
7777
return "replaced"
7878
}
7979

80-
@usableFromInline
81-
func ufi() -> some O {
82-
return 1
83-
}
84-
8580
extension String: P {
8681
public func poo() -> some O {
8782
return 0

0 commit comments

Comments
 (0)