Skip to content

Commit dc1c34d

Browse files
committed
[Sema] Treat @usableFromInline package decls from interface as public and skip access checks
Resolves rdar://133319906
1 parent 647657c commit dc1c34d

12 files changed

+120
-49
lines changed

include/swift/AST/Decl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2973,6 +2973,14 @@ class ValueDecl : public Decl {
29732973
/// \c \@usableFromInline, \c \@inlinalbe, and \c \@_alwaysEmitIntoClient
29742974
bool isUsableFromInline() const;
29752975

2976+
/// Treat as public and allow skipping access checks if the following conditions
2977+
/// are met:
2978+
/// - This decl has a package access level,
2979+
/// - Has a @usableFromInline (or other inlinable) attribute,
2980+
/// - And is defined in a module built from a public or private
2981+
/// interface that does not contain package-name.
2982+
bool isPackageEffectivelyPublic() const;
2983+
29762984
/// Returns \c true if this declaration is *not* intended to be used directly
29772985
/// by application developers despite the visibility.
29782986
bool shouldHideFromEditor() const;

include/swift/Option/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def disable_bridging_pch : Flag<["-"], "disable-bridging-pch">,
727727

728728
def disable_print_package_name_for_non_package_interface :
729729
Flag<["-"], "disable-print-package-name-for-non-package-interface">,
730-
Flags<[FrontendOption, NoDriverOption, ModuleInterfaceOption, HelpHidden]>,
730+
Flags<[FrontendOption, NoDriverOption, HelpHidden]>,
731731
HelpText<"Disable adding package name to public or private interface">;
732732

733733
def lto : Joined<["-"], "lto=">,

lib/AST/ASTVerifier.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,8 @@ class Verifier : public ASTWalker {
10151015
PrettyStackTraceDecl debugStack("verifying access", D);
10161016
if (!D->getASTContext().isAccessControlDisabled()) {
10171017
if (D->getFormalAccessScope().isPublic() &&
1018-
D->getFormalAccess() < AccessLevel::Public) {
1018+
D->getFormalAccess() < AccessLevel::Public &&
1019+
!D->isPackageEffectivelyPublic()) {
10191020
Out << "non-public decl has no formal access scope\n";
10201021
D->dump(Out);
10211022
abort();

lib/AST/Decl.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,6 +4212,21 @@ bool ValueDecl::isUsableFromInline() const {
42124212
return false;
42134213
}
42144214

4215+
bool ValueDecl::isPackageEffectivelyPublic() const {
4216+
// If a package decl has a @usableFromInline (or other inlinable)
4217+
// attribute, and is defined in a module built from interface, it
4218+
// can be referenced by another module that imports it even though
4219+
// the defining interface module does not have package-name (such
4220+
// as public or private interface); in such case, the decl is treated
4221+
// as public and access checks in sema are skipped.
4222+
// We might need to add another check here to ensure the interface
4223+
// was part of the same package before the package-name was removed.
4224+
return getFormalAccess() == AccessLevel::Package &&
4225+
isUsableFromInline() &&
4226+
getModuleContext()->getPackageName().empty() &&
4227+
getModuleContext()->isBuiltFromInterface();
4228+
}
4229+
42154230
bool ValueDecl::shouldHideFromEditor() const {
42164231
// Hide private stdlib declarations.
42174232
if (isPrivateStdlibDecl(/*treatNonBuiltinProtocolsAsPublic*/ false) ||
@@ -4304,6 +4319,9 @@ static AccessLevel getAdjustedFormalAccess(const ValueDecl *VD,
43044319
if (useDC && VD->getASTContext().isAccessControlDisabled())
43054320
return getMaximallyOpenAccessFor(VD);
43064321

4322+
if (VD->isPackageEffectivelyPublic())
4323+
return AccessLevel::Public;
4324+
43074325
if (treatUsableFromInlineAsPublic &&
43084326
access < AccessLevel::Public &&
43094327
VD->isUsableFromInline()) {
@@ -4486,6 +4504,8 @@ getAccessScopeForFormalAccess(const ValueDecl *VD,
44864504
case AccessLevel::Package: {
44874505
auto pkg = resultDC->getPackageContext(/*lookupIfNotCurrent*/ true);
44884506
if (!pkg) {
4507+
if (VD->isPackageEffectivelyPublic())
4508+
return AccessScope::getPublic();
44894509
// Instead of reporting and failing early, return the scope of resultDC to
44904510
// allow continuation (should still non-zero exit later if in script mode)
44914511
return AccessScope(resultDC);
@@ -4621,6 +4641,9 @@ static bool checkAccess(const DeclContext *useDC, const ValueDecl *VD,
46214641
if (VD->getASTContext().isAccessControlDisabled())
46224642
return true;
46234643

4644+
if (VD->isPackageEffectivelyPublic())
4645+
return true;
4646+
46244647
auto access = getAccessLevel();
46254648
auto *sourceDC = VD->getDeclContext();
46264649

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4277,6 +4277,9 @@ ConformanceChecker::resolveWitnessViaLookup(ValueDecl *requirement) {
42774277
requiredAccessScope.requiredAccessForDiagnostics();
42784278
auto proto = conformance->getProtocol();
42794279
auto protoAccessScope = proto->getFormalAccessScope(DC);
4280+
if (proto->isPackageEffectivelyPublic())
4281+
return;
4282+
42804283
bool protoForcesAccess =
42814284
requiredAccessScope.hasEqualDeclContextWith(protoAccessScope);
42824285
auto diagKind = protoForcesAccess

test/ModuleInterface/load_package_interface.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// RUN: %target-swift-frontend -emit-module %t/Bar.swift -I %t \
66
// RUN: -module-name Bar -package-name foopkg -package-name barpkg \
77
// RUN: -enable-library-evolution -swift-version 5 \
8+
// RUN: -disable-print-package-name-for-non-package-interface \
89
// RUN: -emit-module-interface-path %t/Bar.swiftinterface \
910
// RUN: -emit-private-module-interface-path %t/Bar.private.swiftinterface \
1011
// RUN: -emit-package-module-interface-path %t/Bar.package.swiftinterface
@@ -31,7 +32,8 @@
3132
// RUN: -package-name barpkg \
3233
// RUN: -Rmodule-loading 2> %t/load-pkg-off.output
3334
// RUN: %FileCheck -check-prefix=CHECK-LOAD-PKG-OFF %s < %t/load-pkg-off.output
34-
// CHECK-LOAD-PKG-OFF: error: module 'Bar' is in package 'barpkg' but was built from a non-package interface; modules of the same package can only be loaded if built from source or package interface:{{.*}}Bar.private.swiftinterface
35+
// CHECK-LOAD-PKG-OFF: remark: loaded module 'Bar'; source: '{{.*}}Bar.private.swiftinterface', loaded: '{{.*}}Bar-{{.*}}.swiftmodule'
36+
// CHECK-LOAD-PKG-OFF: error: cannot find 'PkgKlass' in scope; did you mean 'PubKlass'?
3537

3638
/// Client loads a private interface since the package-name is different from the loaded module's.
3739
// RUN: not %target-swift-frontend -typecheck %t/Client.swift -I %t \
@@ -45,13 +47,15 @@
4547
// RUN: rm -rf %t/*.swiftmodule
4648
// RUN: rm -rf %t/Bar.package.swiftinterface
4749

48-
/// Client loads a private interface since package interface doesn't exist. It should error since the loaded module is not built from a package interface.
50+
/// Client loads a private interface since package interface doesn't exist. It should error since the
51+
/// loaded module is not built from a package interface.
4952
// RUN: not %target-swift-frontend -typecheck %t/Client.swift -I %t \
5053
// RUN: -package-name barpkg \
5154
// RUN: -experimental-package-interface-load \
5255
// RUN: -Rmodule-loading 2> %t/load-priv.output
5356
// RUN: %FileCheck -check-prefix=CHECK-LOAD-PRIV %s < %t/load-priv.output
54-
// CHECK-LOAD-PRIV: no such module 'Bar'
57+
// CHECK-LOAD-PRIV: remark: loaded module 'Bar'; source: '{{.*}}Bar.private.swiftinterface', loaded: '{{.*}}Bar-{{.*}}.swiftmodule'
58+
// CHECK-LOAD-PRIV: error: cannot find 'PkgKlass' in scope; did you mean 'PubKlass'?
5559

5660
// RUN: rm -rf %t/*.swiftmodule
5761
// RUN: rm -rf %t/Bar.private.swiftinterface
@@ -64,7 +68,8 @@
6468
// RUN: -Rmodule-loading 2> %t/load-pub.output
6569

6670
// RUN: %FileCheck -check-prefix=CHECK-LOAD-PUB %s < %t/load-pub.output
67-
// CHECK-LOAD-PUB: no such module 'Bar'
71+
// CHECK-LOAD-PUB: remark: loaded module 'Bar'; source: '{{.*}}Bar.swiftinterface', loaded: '{{.*}}Bar-{{.*}}.swiftmodule'
72+
// CHECK-LOAD-PUB: error: cannot find 'PkgKlass' in scope; did you mean 'PubKlass'?
6873

6974
//--- Bar.swift
7075
public class PubKlass {

test/ModuleInterface/package_interface_disable_package_name.swift

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
23

34
/// Do not print package-name for public or private interfaces
4-
// RUN: %target-build-swift -emit-module %s -I %t \
5+
// RUN: %target-build-swift -emit-module %t/Bar.swift -I %t \
56
// RUN: -module-name Bar -package-name foopkg \
67
// RUN: -enable-library-evolution -swift-version 6 \
78
// RUN: -package-name barpkg \
@@ -20,24 +21,31 @@
2021
// CHECK-PRIVATE-NOT: -package-name barpkg
2122
// CHECK-PACKAGE-NOT: -package-name foopkg
2223

23-
// CHECK-PUBLIC: -enable-library-evolution -swift-version 6 -disable-print-package-name-for-non-package-interface -module-name Bar
24-
// CHECK-PRIVATE: -enable-library-evolution -swift-version 6 -disable-print-package-name-for-non-package-interface -module-name Bar
25-
// CHECK-PACKAGE: -enable-library-evolution -swift-version 6 -disable-print-package-name-for-non-package-interface -module-name Bar -package-name barpkg
24+
// CHECK-PUBLIC: -enable-library-evolution -swift-version 6 -module-name Bar
25+
// CHECK-PRIVATE: -enable-library-evolution -swift-version 6 -module-name Bar
26+
// CHECK-PACKAGE: -enable-library-evolution -swift-version 6 -module-name Bar -package-name barpkg
2627

2728
/// Verify building modules from non-package interfaces succeeds without the package-name flag.
2829
// RUN: %target-swift-frontend -compile-module-from-interface %t/Bar.swiftinterface -o %t/Bar.swiftmodule -module-name Bar
30+
// RUN: %target-swift-frontend -typecheck %t/Use.swift -I %t -verify
31+
// RUN: %target-swift-frontend -typecheck %t/Use.swift -I %t -package-name barpkg -verify
32+
2933
// RUN: rm -rf %t/Bar.swiftmodule
3034
// RUN: %target-swift-frontend -compile-module-from-interface %t/Bar.private.swiftinterface -o %t/Bar.swiftmodule -module-name Bar
35+
// RUN: %target-swift-frontend -typecheck %t/Use.swift -I %t -verify
36+
// RUN: %target-swift-frontend -typecheck %t/Use.swift -I %t -package-name barpkg -verify
37+
3138
// RUN: rm -rf %t/Bar.swiftmodule
3239
// RUN: %target-swift-frontend -compile-module-from-interface %t/Bar.package.swiftinterface -o %t/Bar.swiftmodule -module-name Bar
40+
// RUN: %target-swift-frontend -typecheck %t/Use.swift -I %t -package-name barpkg -experimental-package-interface-load -verify
3341

3442
// RUN: rm -rf %t/Bar.swiftmodule
3543
// RUN: rm -rf %t/Bar.swiftinterface
3644
// RUN: rm -rf %t/Bar.private.swiftinterface
3745
// RUN: rm -rf %t/Bar.package.swiftinterface
3846

3947
/// By default, -package-name is printed in all interfaces.
40-
// RUN: %target-build-swift -emit-module %s -I %t \
48+
// RUN: %target-build-swift -emit-module %t/Bar.swift -I %t \
4149
// RUN: -module-name Bar -package-name barpkg \
4250
// RUN: -enable-library-evolution -swift-version 6 \
4351
// RUN: -emit-module-interface-path %t/Bar.swiftinterface \
@@ -52,11 +60,46 @@
5260

5361
/// Building modules from non-package interfaces with package-name (default mode) should succeed.
5462
// RUN: %target-swift-frontend -compile-module-from-interface %t/Bar.swiftinterface -o %t/Bar.swiftmodule -module-name Bar
63+
// RUN: %target-swift-frontend -typecheck %t/ExpectFail.swift -I %t -package-name barpkg -verify
64+
5565
// RUN: rm -rf %t/Bar.swiftmodule
5666
// RUN: %target-swift-frontend -compile-module-from-interface %t/Bar.private.swiftinterface -o %t/Bar.swiftmodule -module-name Bar
67+
// RUN: %target-swift-frontend -typecheck %t/ExpectFail.swift -I %t -package-name barpkg -verify
68+
5769
// RUN: rm -rf %t/Bar.swiftmodule
5870
// RUN: %target-swift-frontend -compile-module-from-interface %t/Bar.package.swiftinterface -o %t/Bar.swiftmodule -module-name Bar
71+
// RUN: %target-swift-frontend -typecheck %t/Use.swift -I %t -package-name barpkg -experimental-package-interface-load -verify
5972

73+
//--- Bar.swift
6074
public struct PubStruct {}
6175
@_spi(bar) public struct SPIStruct {}
6276
package struct PkgStruct {}
77+
78+
@usableFromInline
79+
package struct UfiPkgStruct {
80+
@usableFromInline
81+
package var ufiPkgVar: PubStruct
82+
83+
package var pkgVar: PubStruct
84+
85+
@usableFromInline
86+
package init(_ x: PubStruct, _ y: PubStruct) {
87+
ufiPkgVar = x
88+
pkgVar = y
89+
}
90+
}
91+
92+
93+
//--- Use.swift
94+
import Bar
95+
96+
func use(_ arg: PubStruct) -> PubStruct {
97+
return UfiPkgStruct(arg, arg).ufiPkgVar
98+
}
99+
100+
//--- ExpectFail.swift
101+
import Bar // expected-error {{module 'Bar' is in package 'barpkg' but was built from a non-package interface; modules of the same package can only be loaded if built from source or package interface}}
102+
103+
func use(_ arg: PubStruct) -> PubStruct {
104+
return UfiPkgStruct(arg, arg).ufiPkgVar
105+
}

test/Sema/accessibility_package_import_interface.swift

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@
66
// RUN: -module-name Dep -swift-version 5 -I %t \
77
// RUN: -package-name myPkg \
88
// RUN: -enable-library-evolution \
9+
// RUN: -disable-print-package-name-for-non-package-interface \
910
// RUN: -emit-module-path %t/Dep.swiftmodule \
1011
// RUN: -emit-module-interface-path %t/Dep.swiftinterface \
1112
// RUN: -emit-private-module-interface-path %t/Dep.private.swiftinterface
1213

13-
// TEST Dep private interface should contain the package name
14-
// RUN: %target-swift-typecheck-module-from-interface(%t/Dep.private.swiftinterface) -module-name Dep -I %t
15-
// RUN: %FileCheck %s --check-prefix=CHECK-DEP-PRIVATE < %t/Dep.private.swiftinterface
16-
// CHECK-DEP-PRIVATE: -package-name myPkg
17-
1814
// TEST Dep.swiftmodule should contain package name and package symbols
1915
// RUN: llvm-bcanalyzer --dump %t/Dep.swiftmodule | %FileCheck %s --check-prefix=CHECK-DEP-BC
20-
// CHECK-DEP-BC: <MODULE_PACKAGE_NAME abbrevid=6/> blob data = 'myPkg'
16+
// CHECK-DEP-BC: <MODULE_PACKAGE_NAME {{.*}}> blob data = 'myPkg'
2117

2218
// TEST Lib should load Dep.swiftmodule and access package decls if in the same package and error if not
2319
// RUN: %target-swift-frontend -typecheck %t/Lib.swift -package-name myPkg -I %t
@@ -39,9 +35,9 @@
3935
// RUN: -module-name Dep -I %t \
4036
// RUN: -o %t/Dep.swiftmodule
4137

42-
// TEST Dep binary built from interface should contain package name but no package symbols
38+
// TEST Dep binary built from interface should not contain package name or package symbols.
4339
// RUN: llvm-bcanalyzer --dump %t/Dep.swiftmodule | %FileCheck %s --check-prefix=CHECK-DEP-INTER-BC
44-
// CHECK-DEP-INTER-BC: <MODULE_PACKAGE_NAME abbrevid=7/> blob data = 'myPkg'
40+
// CHECK-DEP-INTER-BC-NOT: <MODULE_PACKAGE_NAME {{.*}}> blob data = 'myPkg'
4541

4642
// TEST Lib should error on loading Dep built from interface and accessing package symbols (unless usableFromInline or inlinable)
4743
// RUN: %target-swift-frontend -typecheck %t/Lib.swift -package-name myPkg -I %t -verify
@@ -59,6 +55,7 @@
5955
// RUN: -module-name LibPass -swift-version 5 -I %t \
6056
// RUN: -package-name myPkg \
6157
// RUN: -enable-library-evolution \
58+
// RUN: -disable-print-package-name-for-non-package-interface \
6259
// RUN: -emit-module-path %t/LibPass.swiftmodule \
6360
// RUN: -emit-module-interface-path %t/LibPass.swiftinterface \
6461
// RUN: -emit-private-module-interface-path %t/LibPass.private.swiftinterface
@@ -86,8 +83,11 @@
8683
@usableFromInline
8784
package class PackageKlassUFI {
8885
@usableFromInline package init() {}
89-
@usableFromInline package var packageVarUFI: String = "pkgUFI"
9086
package var packageVar: String = "pkg"
87+
88+
@usableFromInline package var packageVarUFI: String = "pkgUFI"
89+
// expected-note@-1 * {{'packageVarUFI' declared here}}
90+
// expected-error@-1 * {{'packageVarUFI' declared here}}
9191
}
9292

9393
package func packageFunc() {
@@ -109,7 +109,7 @@ public func publicFuncInlinable() {
109109
}
110110

111111
//--- Lib.swift
112-
import Dep // expected-error {{module 'Dep' is in package 'myPkg' but was built from a non-package interface; modules of the same package can only be loaded if built from source or package interface}}
112+
import Dep
113113

114114
public func libFunc() {
115115
publicFuncInlinable()
@@ -118,8 +118,7 @@ public func libFunc() {
118118
packageFunc() // expected-error {{cannot find 'packageFunc' in scope}}
119119
let x = PackageKlassUFI()
120120
let y = x.packageVarUFI
121-
let z = x.packageVar // expected-error {{value of type 'PackageKlassUFI' has no member 'packageVar'}}
122-
print(x, y, z)
121+
print(x, y)
123122
}
124123

125124

test/Sema/accessibility_package_inline_interface.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %{python} %utils/split_file.py -o %t %s
2+
// RUN: split-file %s %t
33

44
// RUN: %target-swift-frontend -module-name Utils1 %t/Utils.swift -emit-module -emit-module-path %t/Utils1.swiftmodule -package-name myLib -swift-version 5
55
// RUN: test -f %t/Utils1.swiftmodule
66

7-
// RUN: %target-swift-frontend -module-name Utils %t/Utils.swift -emit-module -emit-module-interface-path %t/Utils.swiftinterface -package-name myLib -enable-library-evolution -swift-version 5
7+
// RUN: %target-swift-frontend -module-name Utils %t/Utils.swift -emit-module -emit-module-interface-path %t/Utils.swiftinterface -package-name myLib -enable-library-evolution -swift-version 5 -disable-print-package-name-for-non-package-interface
8+
89
// RUN: test -f %t/Utils.swiftinterface
910
// RUN: %target-swift-typecheck-module-from-interface(%t/Utils.swiftinterface) -I%t
1011

1112
// RUN: %FileCheck %s -check-prefix CHECK-UTILS < %t/Utils.swiftinterface
1213
// CHECK-UTILS: -module-name Utils
13-
// CHECK-UTILS: -package-name myLib
1414
// CHECK-UTILS: @usableFromInline
1515
// CHECK-UTILS: package class PackageKlassProto {
1616
// CHECK-UTILS: @usableFromInline
@@ -70,7 +70,7 @@
7070
// CHECK-UTILS: }
7171

7272

73-
// BEGIN Utils.swift
73+
//--- Utils.swift
7474
package protocol PackageProto {
7575
var pkgVar: Double { get set }
7676
func pkgFunc()

test/Sema/accessibility_package_interface.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: -module-name Utils -swift-version 5 -I %t \
66
// RUN: -package-name swift-utils.log \
77
// RUN: -enable-library-evolution \
8-
// RUN: -emit-module-path %t/Utils.swiftmodule \
8+
// RUN: -disable-print-package-name-for-non-package-interface \
99
// RUN: -emit-module-interface-path %t/Utils.swiftinterface \
1010
// RUN: -emit-private-module-interface-path %t/Utils.private.swiftinterface
1111

@@ -18,7 +18,6 @@
1818
// CHECK-PUBLIC-UTILS-NOT: package class PackageKlass
1919
// CHECK-PUBLIC-UTILS-NOT: package var pkgVar
2020
// CHECK-PUBLIC-UTILS: -module-name Utils
21-
// CHECK-PUBLIC-UTILS: -package-name swift-utils.log
2221
// CHECK-PUBLIC-UTILS: public func publicFunc()
2322
// CHECK-PUBLIC-UTILS: @usableFromInline
2423
// CHECK-PUBLIC-UTILS: package func ufiPackageFunc()
@@ -39,7 +38,6 @@
3938
// CHECK-PRIVATE-UTILS-NOT: package class PackageKlass
4039
// CHECK-PRIVATE-UTILS-NOT: package var pkgVar
4140
// CHECK-PRIVATE-UTILS: -module-name Utils
42-
// CHECK-PRIVATE-UTILS: -package-name swift-utils.log
4341
// CHECK-PRIVATE-UTILS: public func publicFunc()
4442
// CHECK-PRIVATE-UTILS: @usableFromInline
4543
// CHECK-PRIVATE-UTILS: package func ufiPackageFunc()
@@ -51,20 +49,19 @@
5149
// CHECK-PRIVATE-UTILS: @usableFromInline
5250
// CHECK-PRIVATE-UTILS: package var ufiPkgVar
5351

52+
// RUN: %target-swift-frontend -compile-module-from-interface %t/Utils.private.swiftinterface -module-name Utils -I %t -o %t/Utils.swiftmodule
53+
5454
// RUN: %target-swift-frontend -emit-module %t/Client.swift \
5555
// RUN: -module-name Client -swift-version 5 -I %t \
5656
// RUN: -package-name swift-utils.log \
5757
// RUN: -enable-library-evolution \
58+
// RUN: -disable-print-package-name-for-non-package-interface \
5859
// RUN: -emit-module-path %t/Client.swiftmodule \
5960
// RUN: -emit-module-interface-path %t/Client.swiftinterface \
6061
// RUN: -emit-private-module-interface-path %t/Client.private.swiftinterface
6162

62-
// RUN: rm -rf %t/Utils.swiftmodule
63-
// RUN: rm -rf %t/Client.swiftmodule
64-
6563
// RUN: %target-swift-typecheck-module-from-interface(%t/Client.swiftinterface) -I %t -verify
6664
// RUN: %FileCheck %s --check-prefix=CHECK-PUBLIC-CLIENT < %t/Client.swiftinterface
67-
// CHECK-PUBLIC-CLIENT: -package-name swift-utils.log
6865
// CHECK-PUBLIC-CLIENT: @inlinable public func clientFunc()
6966
// CHECK-PUBLIC-CLIENT: publicFunc()
7067
// CHECK-PUBLIC-CLIENT: ufiPackageFunc()
@@ -113,6 +110,7 @@ import Utils
113110
@inlinable public func clientFunc() -> String {
114111
publicFunc()
115112
ufiPackageFunc()
113+
// return UfiPackageKlass().ufiPkgVar
116114
let u = UfiPackageKlass()
117115
return u.ufiPkgVar
118116
}

0 commit comments

Comments
 (0)