5
5
6
6
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-pch -F %S/Inputs/frameworks -o %t.pch %t.h
7
7
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -F %S/Inputs/frameworks -enable-objc-interop -import-objc-header %t.pch %s 2>&1 | %FileCheck --allow-empty -check-prefix=CHECK -check-prefix=CHECK-PRIVATE %s
8
- // RUNT : %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -F %S/Inputs/frameworks -enable-objc-interop -import-objc-header %t.h -pch-output-dir %t/pch %s 2>&1 | %FileCheck --allow-empty -check-prefix=CHECK -check-prefix=CHECK-PRIVATE %s
8
+ // RUN : %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -F %S/Inputs/frameworks -enable-objc-interop -import-objc-header %t.h -pch-output-dir %t/pch %s 2>&1 | %FileCheck --allow-empty -check-prefix=CHECK -check-prefix=CHECK-PRIVATE %s
9
9
10
10
import CategoryOverrides
11
11
@@ -19,10 +19,25 @@ import CategoryOverrides
19
19
// This configuration appears as an undiagnosed redeclaration of a property and
20
20
// function, which is illegal.
21
21
func colors( ) {
22
+ // CHECK-PUBLIC: cannot call value of non-function type 'MyColor?'
23
+ // CHECK-PRIVATE-NOT: cannot call value of non-function type 'MyColor?'
22
24
let _ : MyColor = MyColor . systemRed
23
25
let _ : MyColor = MyColor . systemRed ( ) !
24
26
}
25
27
28
+ // Another manifestation of the above for an instance property this time.
29
+ func structs( _ base: MyBaseClass , _ derived: MyDerivedClass ) {
30
+ // CHECK-PUBLIC: cannot call value of non-function type 'SomeStruct'
31
+ // CHECK-PRIVATE-NOT: cannot call value of non-function type 'SomeStruct'
32
+ let _ : SomeStruct = base. myStructure
33
+ let _ : SomeStruct = base. myStructure ( )
34
+
35
+ // CHECK-PUBLIC: cannot call value of non-function type 'SomeStruct'
36
+ // CHECK-PRIVATE-NOT: cannot call value of non-function type 'SomeStruct'
37
+ let _ : SomeStruct = derived. myStructure
38
+ let _ : SomeStruct = derived. myStructure ( )
39
+ }
40
+
26
41
// A category declared in a (private) header can introduce overrides of a property
27
42
// that is otherwise not declared in a base class.
28
43
//
0 commit comments