12
12
//// The client app should build OK without the private module. Removing the
13
13
//// private module is superfluous but makes sure that it's not somehow loaded.
14
14
// RUN: rm %t/private_lib.swiftmodule
15
- // RUN: %target-swift-frontend -typecheck -DCLIENT_APP -primary-file %s -I %t -index-system-modules -index-store-path %t
16
- // RUN: %target-swift-frontend -emit-sil -DCLIENT_APP -primary-file %s -I %t -module-name client
15
+ // RUN: %target-swift-frontend -typecheck -DCLIENT_APP %s -I %t -index-system-modules -index-store-path %t
16
+ // RUN: %target-swift-frontend -typecheck -DCLIENT_APP %s -I %t -D FAIL_TYPECHECK -verify
17
+ // RUN: %target-swift-frontend -emit-sil -DCLIENT_APP %s -I %t -module-name client
17
18
18
19
//// Printing the public module should not crash when checking for overrides of
19
20
//// methods from the private module.
@@ -46,6 +47,8 @@ public protocol HiddenProtocolWithOverride {
46
47
func hiddenOverride( )
47
48
}
48
49
50
+ public class HiddenClass { }
51
+
49
52
#elseif PUBLIC_LIB
50
53
51
54
@_implementationOnly import private_lib
@@ -91,6 +94,10 @@ public struct PublicStructConformsToHiddenProtocol: RefinesHiddenProtocol {
91
94
public init ( ) { }
92
95
}
93
96
97
+ public class SomeClass {
98
+ func funcUsingIoiType( _ a: HiddenClass ) { }
99
+ }
100
+
94
101
#elseif CLIENT_APP
95
102
96
103
import public_lib
@@ -101,4 +108,12 @@ print(s.nonWrappedVar)
101
108
var p = PublicStructConformsToHiddenProtocol ( )
102
109
print ( p)
103
110
111
+ #if FAIL_TYPECHECK
112
+ // Access to a missing member on an AnyObject triggers a typo correction
113
+ // that looks at *all* class members. rdar://79427805
114
+ class ClassUnrelatedToSomeClass { }
115
+ var something = ClassUnrelatedToSomeClass ( ) as AnyObject
116
+ something. triggerTypoCorrection = 123 // expected-error {{value of type 'AnyObject' has no member 'triggerTypoCorrection'}}
117
+ #endif
118
+
104
119
#endif
0 commit comments