Skip to content

Commit 1a18225

Browse files
committed
Polish PR
1 parent 58ff402 commit 1a18225

19 files changed

+74
-129
lines changed

lib/Sema/TypeCheckAccess.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,6 @@ swift::getDisallowedOriginKind(const Decl *decl,
15191519
if (auto clangDecl = decl->getClangDecl()) {
15201520
for (auto redecl : clangDecl->redecls()) {
15211521
if (!visibleModules.contains(redecl->getOwningModule())) {
1522-
redecl->getOwningModule()->dump();
15231522
continue;
15241523
}
15251524

test/Interop/C/implementation-only-imports/lookup-visible-decls-recursively-inversed.swift renamed to test/Interop/C/implementation-only-imports/check-function-transitive-visibility-inversed.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55

66
// RUN: %target-swift-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs %s
77

8-
9-
// If a decl comes from two modules, one of which is marked as
10-
// @_implementationOnly, Swift may choose the @_implementationOnly source
11-
// and then error out due to the decl being hidden.
12-
13-
// Swift should consider all sources for the decl and recognize that the
8+
// Swift should consider all sources for a decl and recognize that the
149
// decl is not hidden behind @_implementationOnly in all modules.
1510

16-
// This test, as well as `lookup-visible-decls-recursively.swift`
11+
// This test, as well as `check-function-transitive-visibility.swift`
1712
// ensures that Swift looks into the transitive visible modules as well
18-
// when looking for the `getFortyTwo` decl.
13+
// when looking for the `getFortyTwo()` decl.
1914

2015
import UseModuleA
2116
@_implementationOnly import UseModuleB

test/Interop/C/implementation-only-imports/lookup-visible-decls-recursively.swift renamed to test/Interop/C/implementation-only-imports/check-function-transitive-visibility.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55

66
// RUN: %target-swift-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs %s
77

8-
9-
// If a decl comes from two modules, one of which is marked as
10-
// @_implementationOnly, Swift may choose the @_implementationOnly source
11-
// and then error out due to the decl being hidden.
12-
13-
// Swift should consider all sources for the decl and recognize that the
8+
// Swift should consider all sources for a decl and recognize that the
149
// decl is not hidden behind @_implementationOnly in all modules.
1510

16-
// This test, as well as `lookup-visible-decls-recursively-inversed.swift`
11+
// This test, as well as `check-function-transitive-visibility-inversed.swift`
1712
// ensures that Swift looks into the transitive visible modules as well
18-
// when looking for the `getFortyTwo` decl.
13+
// when looking for the `getFortyTwo()` decl.
1914

2015
import UseModuleA
2116
@_implementationOnly import UseModuleB
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

4-
// If a decl comes from two modules, one of which is marked as
5-
// @_implementationOnly, Swift may choose the @_implementationOnly source
6-
// and then error out due to the decl being hidden.
7-
8-
// Swift should consider all sources for the decl and recognize that the
4+
// Swift should consider all sources for a decl and recognize that the
95
// decl is not hidden behind @_implementationOnly in all modules.
106

11-
// This test, as well as
12-
// `prefer-a-visible-decl-over-implementation-only-decls.swift`
7+
// This test, as well as `check-function-visibility.swift`
138
// checks that the `getFortyTwo` decl can be found when at least one of the
149
// modules is not `@_implementationOnly`.
1510

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
3+
4+
// Swift should consider all sources for a decl and recognize that the
5+
// decl is not hidden behind @_implementationOnly in all modules.
6+
7+
// This test, as well as `check-function-visibility-inversed.swift`
8+
// checks that the `getFortyTwo()` decl can be found when at least one of the
9+
// modules is not `@_implementationOnly`.
10+
11+
@_implementationOnly import UserA
12+
import UserB
13+
14+
@_inlineable
15+
public func callFortyTwo() -> CInt {
16+
return getFortyTwo()
17+
}

test/Interop/C/implementation-only-imports/prefer-a-visible-decl-over-implementation-only-decls.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef TEST_INTEROP_CXX_IMPLEMENTATION_ONLY_IMPORTS_INPUTS_USER_C_H
22
#define TEST_INTEROP_CXX_IMPLEMENTATION_ONLY_IMPORTS_INPUTS_USER_C_H
33

4-
int getFortyTwo();
5-
64
class MagicWrapper;
75

86
#endif // TEST_INTEROP_CXX_IMPLEMENTATION_ONLY_IMPORTS_INPUTS_USER_C_H

test/Interop/Cxx/implementation-only-imports/check-constructor-visibility-inversed.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
33

4-
// If a decl comes from two modules, one of which is marked as
5-
// @_implementationOnly, Swift may choose the @_implementationOnly source
6-
// and then error out due to the decl being hidden.
7-
8-
// Swift should consider all sources for the decl and recognize that the
4+
// Swift should consider all sources for a decl and recognize that the
95
// decl is not hidden behind @_implementationOnly in all modules.
106

117
// This test, as well as `check-constructor-visibility.swift` checks

test/Interop/Cxx/implementation-only-imports/check-constructor-visibility.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
33

4-
// If a decl comes from two modules, one of which is marked as
5-
// @_implementationOnly, Swift may choose the @_implementationOnly source
6-
// and then error out due to the decl being hidden.
7-
8-
// Swift should consider all sources for the decl and recognize that the
4+
// Swift should consider all sources for a decl and recognize that the
95
// decl is not hidden behind @_implementationOnly in all modules.
106

117
// This test, as well as `check-constructor-visibility-inversed.swift` checks

test/Interop/Cxx/implementation-only-imports/check-decls-are-identical.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: not %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs -enable-cxx-interop %s 2>&1 | %FileCheck %s
33

4-
// This test check that Swift recognizes that the DeclA and DeclB provide
4+
// This test checks that Swift recognizes that the DeclA and DeclB provide
55
// different implementations for `getFortySomething()`
66

77
@_implementationOnly import DeclA

0 commit comments

Comments
 (0)