|
20 | 20 | // CHECK-DEP-BC: <MODULE_PACKAGE_NAME abbrevid=6/> blob data = 'myPkg' |
21 | 21 |
|
22 | 22 | // TEST Lib should load Dep.swiftmodule and access package decls if in the same package and error if not |
23 | | - |
24 | | -// RUN: %target-swift-frontend -typecheck %t/Lib.swift -package-name myPkg -I %t -verify |
| 23 | +// RUN: %target-swift-frontend -typecheck %t/Lib.swift -package-name myPkg -I %t |
25 | 24 |
|
26 | 25 | // RUN: not %target-swift-frontend -typecheck %t/Lib.swift -package-name otherPkg -I %t -Rmodule-loading 2> %t/result-binary-other-pkg.output |
27 | 26 | // RUN: %FileCheck %s --check-prefix=CHECK-DIFF-PKG < %t/result-binary-other-pkg.output |
|
45 | 44 | // CHECK-DEP-INTER-BC: <MODULE_PACKAGE_NAME abbrevid=7/> blob data = 'myPkg' |
46 | 45 |
|
47 | 46 | // TEST Lib should error on loading Dep built from interface and accessing package symbols (unless usableFromInline or inlinable) |
48 | | -// RUN: not %target-swift-frontend -typecheck %t/Lib.swift -package-name myPkg -I %t 2> %t/result-access.output |
49 | | -// RUN: %FileCheck %s --check-prefix CHECK-LIB < %t/result-access.output |
50 | | -// CHECK-LIB: error: module 'Dep' is in package 'myPkg' but was built from interface; modules of the same package can only be loaded if built from source |
51 | | -// CHECK-LIB: error: cannot find 'packageFunc' in scope |
52 | | -// CHECK-LIB: error: value of type 'PackageKlassUFI' has no member 'packageVar' |
| 47 | +// RUN: %target-swift-frontend -typecheck %t/Lib.swift -package-name myPkg -I %t -verify |
53 | 48 |
|
54 | 49 | // TEST Remove and rebuild Dep from source |
55 | 50 | // RUN: rm %t/Dep.swiftmodule |
@@ -114,16 +109,16 @@ public func publicFuncInlinable() { |
114 | 109 | } |
115 | 110 |
|
116 | 111 | //--- Lib.swift |
117 | | -import Dep |
| 112 | +import Dep // expected-error {{module 'Dep' is in package 'myPkg' but was built from interface; modules of the same package can only be loaded if built from source}} |
118 | 113 |
|
119 | 114 | public func libFunc() { |
120 | 115 | publicFuncInlinable() |
121 | 116 | publicFunc() |
122 | 117 | packageFuncInlinable() |
123 | | - packageFunc() |
| 118 | + packageFunc() // expected-error {{cannot find 'packageFunc' in scope}} |
124 | 119 | let x = PackageKlassUFI() |
125 | 120 | let y = x.packageVarUFI |
126 | | - let z = x.packageVar |
| 121 | + let z = x.packageVar // expected-error {{value of type 'PackageKlassUFI' has no member 'packageVar'}} |
127 | 122 | print(x, y, z) |
128 | 123 | } |
129 | 124 |
|
|
0 commit comments