16
16
// RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_NO_DOT_1 > %t.opt.txt
17
17
// RUN: %FileCheck %s -check-prefix=UN_OPT_NO_DOT_FOOSTRUCT < %t.opt.txt
18
18
19
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_NO_DOT_2 > %t.opt.txt
20
- // RUN: %FileCheck %s -check-prefix=UN_OPT_NO_DOT_FOOSTRUCT_RETURN < %t.opt.txt
21
-
22
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_NO_DOT_3 > %t.opt.txt
23
- // RUN: %FileCheck %s -check-prefix=UN_OPT_NO_DOT_INT < %t.opt.txt
24
-
25
19
// RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_DOT_1 > %t.opt.txt
26
20
// RUN: %FileCheck %s -check-prefix=UN_OPT_DOT_FOOSTRUCT < %t.opt.txt
27
21
28
22
// RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_DOT_2 > %t.opt.txt
29
23
// RUN: %FileCheck %s -check-prefix=UN_OPT_DOT_FOOSTRUCT_RETURN < %t.opt.txt
30
24
31
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_DOT_3 > %t.opt.txt
32
- // RUN: %FileCheck %s -check-prefix=UN_OPT_DOT_INT < %t.opt.txt
33
-
34
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_DL_NO_DOT_1 > %t.opt.txt
35
- // RUN: %FileCheck %s -check-prefix=OBJCCLASS_MEMBERS_NO_DOT < %t.opt.txt
36
-
37
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_DL_NO_DOT_2 > %t.opt.txt
38
- // RUN: %FileCheck %s -check-prefix=OBJCCLASS_MEMBERS_NO_DOT < %t.opt.txt
39
-
40
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_DL_DOT_1 > %t.opt.txt
41
- // RUN: %FileCheck %s -check-prefix=OBJCCLASS_MEMBERS_DOT < %t.opt.txt
42
-
43
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_DL_DOT_2 > %t.opt.txt
44
- // RUN: %FileCheck %s -check-prefix=OBJCCLASS_MEMBERS_DOT < %t.opt.txt
45
-
46
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_DL_FORCE_RETURN_OPTIONAL_1 > %t.opt.txt
47
- // RUN: %FileCheck %s -check-prefix=OPT_NO_DOT_OBJCCLASS < %t.opt.txt
48
-
49
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_CAST_AS_RESULT_1 > %t.opt.txt
50
- // RUN: %FileCheck %s -check-prefix=OPT_NO_DOT_OBJCCLASS < %t.opt.txt
25
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=UN_OPT_NO_DOT_2 > %t.opt.txt
26
+ // RUN: %FileCheck %s -check-prefix=UN_OPT_NO_DOT_FOOSTRUCT_RETURN < %t.opt.txt
51
27
52
28
// RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_TUPLE_1 | %FileCheck %s -check-prefix=OPT_TUPLE_1
53
29
// RUN: %target-swift-ide-test -code-completion -source-filename %s -disable-objc-attr-requires-foundation-module -code-completion-token=OPT_TUPLE_2 | %FileCheck %s -check-prefix=OPT_TUPLE_2
@@ -76,12 +52,6 @@ func returnsImplicitlyUnwrappedOptional() -> FooStruct! {
76
52
return FooStruct ( )
77
53
}
78
54
79
- @objc
80
- class ObjcClass {
81
- @objc var instanceVar : Int = 0
82
- @objc func instanceFunc( ) -> ObjcClass { return self }
83
- }
84
-
85
55
// OPT_NO_DOT_FOOSTRUCT: Begin completions
86
56
// OPT_NO_DOT_FOOSTRUCT-DAG: Decl[InstanceVar]/CurrNominal: ?.instanceVar[#Int#]{{; name=.+$}}
87
57
// OPT_NO_DOT_FOOSTRUCT-DAG: Decl[InstanceMethod]/CurrNominal: ?.instanceFunc()[#Void#]{{; name=.+$}}
@@ -97,16 +67,6 @@ class ObjcClass {
97
67
// OPT_DOT_FOOSTRUCT_SPACES-DAG: Decl[InstanceMethod]/CurrNominal/Erase[3]: ?.instanceFunc()[#Void#]{{; name=.+$}}
98
68
// OPT_DOT_FOOSTRUCT_SPACES: End completions
99
69
100
- // UN_OPT_NO_DOT_FOOSTRUCT: Begin completions
101
- // UN_OPT_NO_DOT_FOOSTRUCT-DAG: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{; name=.+$}}
102
- // UN_OPT_NO_DOT_FOOSTRUCT-DAG: Decl[InstanceMethod]/CurrNominal: .instanceFunc()[#Void#]{{; name=.+$}}
103
- // UN_OPT_NO_DOT_FOOSTRUCT: End completions
104
-
105
- // UN_OPT_NO_DOT_FOOSTRUCT_RETURN: Begin completions
106
- // UN_OPT_NO_DOT_FOOSTRUCT_RETURN-DAG: Decl[InstanceVar]/CurrNominal: ?.instanceVar[#Int#]{{; name=.+$}}
107
- // UN_OPT_NO_DOT_FOOSTRUCT_RETURN-DAG: Decl[InstanceMethod]/CurrNominal: ?.instanceFunc()[#Void#]{{; name=.+$}}
108
- // UN_OPT_NO_DOT_FOOSTRUCT_RETURN: End completions
109
-
110
70
// UN_OPT_DOT_FOOSTRUCT: Begin completions
111
71
// UN_OPT_DOT_FOOSTRUCT-DAG: Decl[InstanceVar]/CurrNominal: instanceVar[#Int#]{{; name=.+$}}
112
72
// UN_OPT_DOT_FOOSTRUCT-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc()[#Void#]{{; name=.+$}}
@@ -117,32 +77,6 @@ class ObjcClass {
117
77
// UN_OPT_DOT_FOOSTRUCT_RETURN-DAG: Decl[InstanceMethod]/CurrNominal/Erase[1]: ?.instanceFunc()[#Void#]{{; name=.+$}}
118
78
// UN_OPT_DOT_FOOSTRUCT_RETURN: End completions
119
79
120
- // UN_OPT_NO_DOT_INT: Begin completions
121
- // UN_OPT_NO_DOT_INT-DAG: Decl[InstanceVar]/CurrNominal: ?.nonzeroBitCount[#Int#]{{; name=.+$}}
122
- // UN_OPT_NO_DOT_INT: End completions
123
-
124
- // UN_OPT_DOT_INT: Begin completions
125
- // UN_OPT_DOT_INT-DAG: Decl[InstanceVar]/CurrNominal/Erase[1]: ?.nonzeroBitCount[#Int#]{{; name=.+$}}
126
- // UN_OPT_DOT_INT: End completions
127
-
128
- // OPT_NO_DOT_OBJCCLASS: Begin completions
129
- // OPT_NO_DOT_OBJCCLASS-DAG: Decl[InstanceVar]/CurrNominal: ?.instanceVar[#Int#]{{; name=.+$}}
130
- // OPT_NO_DOT_OBJCCLASS-DAG: Decl[InstanceMethod]/CurrNominal: ?.instanceFunc()[#ObjcClass#]{{; name=.+$}}
131
- // OPT_NO_DOT_OBJCCLASS: End completions
132
-
133
- // OBJCCLASS_MEMBERS_NO_DOT: Begin completions
134
- // OBJCCLASS_MEMBERS_NO_DOT-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]
135
- // OBJCCLASS_MEMBERS_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc()[#ObjcClass#]
136
- // OBJCCLASS_MEMBERS_NO_DOT-NEXT: Decl[InfixOperatorFunction]/OtherModule[Swift]: === {#AnyObject?#}[#Bool#]
137
- // OBJCCLASS_MEMBERS_NO_DOT-NEXT: Decl[InfixOperatorFunction]/OtherModule[Swift]: !== {#AnyObject?#}[#Bool#]
138
- // OBJCCLASS_MEMBERS_NO_DOT-NEXT: Keyword[self]/CurrNominal: .self[#ObjcClass#]; name=self
139
- // OBJCCLASS_MEMBERS_NO_DOT-NEXT: End completions
140
-
141
- // OBJCCLASS_MEMBERS_DOT: Begin completions
142
- // OBJCCLASS_MEMBERS_DOT-NEXT: Keyword[self]/CurrNominal: self[#ObjcClass#]; name=self
143
- // OBJCCLASS_MEMBERS_DOT-NEXT: Decl[InstanceVar]/CurrNominal: instanceVar[#Int#]
144
- // OBJCCLASS_MEMBERS_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc()[#ObjcClass#]
145
- // OBJCCLASS_MEMBERS_DOT-NEXT: End completions
146
80
147
81
//===---
148
82
//===--- Tests.
@@ -184,38 +118,6 @@ func testImplicitlyUnwrappedOptionalReturnValue2() {
184
118
returnsImplicitlyUnwrappedOptional ( ) . #^UN_OPT_DOT_2^#
185
119
}
186
120
187
- func testAnyObject1( a: AnyObject ) {
188
- a. instanceVar#^UN_OPT_NO_DOT_3^#
189
- }
190
-
191
- func testAnyObject2( a: AnyObject ) {
192
- a. instanceVar. #^UN_OPT_DOT_3^#
193
- }
194
-
195
- func testAnyObject3( a: AnyObject ) {
196
- a. instanceFunc!( ) #^OPT_DL_NO_DOT_1^#
197
- }
198
-
199
- func testAnyObject4( a: AnyObject ) {
200
- a. instanceFunc ? ( ) #^OPT_DL_NO_DOT_2^#
201
- }
202
-
203
- func testAnyObject5( a: AnyObject ) {
204
- a. instanceFunc!( ) . #^OPT_DL_DOT_1^#
205
- }
206
-
207
- func testAnyObject6( a: AnyObject ) {
208
- a. instanceFunc ? ( ) . #^OPT_DL_DOT_2^#
209
- }
210
-
211
- func testAnyObject7( a: AnyObject ) {
212
- ( a. instanceFunc ? ( ) ) #^OPT_DL_FORCE_RETURN_OPTIONAL_1^#
213
- }
214
-
215
- func testAnyObject8( a: AnyObject ) {
216
- ( a as? ObjcClass ) #^OPT_CAST_AS_RESULT_1^#
217
- }
218
-
219
121
func testOptionalTuple1( a: ( Int , String ) ? ) {
220
122
a#^OPT_TUPLE_1^#
221
123
}
@@ -245,3 +147,13 @@ func testOptionalTuple5(a: (x: Int, y: String)?) {
245
147
}
246
148
// OPT_TUPLE_5: Pattern/CurrNominal/Erase[1]: ?.x[#Int#]
247
149
// OPT_TUPLE_5: Pattern/CurrNominal/Erase[1]: ?.y[#String#]
150
+
151
+ // UN_OPT_NO_DOT_FOOSTRUCT: Begin completions
152
+ // UN_OPT_NO_DOT_FOOSTRUCT-DAG: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{; name=.+$}}
153
+ // UN_OPT_NO_DOT_FOOSTRUCT-DAG: Decl[InstanceMethod]/CurrNominal: .instanceFunc()[#Void#]{{; name=.+$}}
154
+ // UN_OPT_NO_DOT_FOOSTRUCT: End completions
155
+
156
+ // UN_OPT_NO_DOT_FOOSTRUCT_RETURN: Begin completions
157
+ // UN_OPT_NO_DOT_FOOSTRUCT_RETURN-DAG: Decl[InstanceVar]/CurrNominal: ?.instanceVar[#Int#]{{; name=.+$}}
158
+ // UN_OPT_NO_DOT_FOOSTRUCT_RETURN-DAG: Decl[InstanceMethod]/CurrNominal: ?.instanceFunc()[#Void#]{{; name=.+$}}
159
+ // UN_OPT_NO_DOT_FOOSTRUCT_RETURN: End completions
0 commit comments