Skip to content

Commit f09d2ad

Browse files
committed
[ConstraintSolver] Forbid forming solutions with free generic type parameters
`FreeTypeVariableBinding::GenericParameters` mode allowed to bind all free type variables with fresh generic parameter types, which is incorrect (at least) if there are multiple generic solutions present, because such parameters couldn't be compared. This mode was used for code completion, which is now switched to use `FreeTypeVariableBinding::UnresolvedType` instead.
1 parent b218378 commit f09d2ad

17 files changed

+77
-61
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ Solution ConstraintSystem::finalize(
115115
solverState->BestScore = CurrentScore;
116116
}
117117

118-
// For any of the type variables that has no associated fixed type, assign a
119-
// fresh generic type parameters.
120-
// FIXME: We could gather the requirements on these as well.
121-
unsigned index = 0;
122118
for (auto tv : TypeVariables) {
123119
if (getFixedType(tv))
124120
continue;
@@ -129,10 +125,6 @@ Solution ConstraintSystem::finalize(
129125

130126
case FreeTypeVariableBinding::Allow:
131127
break;
132-
133-
case FreeTypeVariableBinding::GenericParameters:
134-
assignFixedType(tv, GenericTypeParamType::get(0, index++, TC.Context));
135-
break;
136128

137129
case FreeTypeVariableBinding::UnresolvedType:
138130
assignFixedType(tv, TC.Context.TheUnresolvedType);

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ bool TypeChecker::typeCheckCompletionSequence(Expr *&expr, DeclContext *DC) {
20582058

20592059
// Attempt to solve the constraint system.
20602060
SmallVector<Solution, 4> viable;
2061-
if (CS.solve(viable, FreeTypeVariableBinding::GenericParameters))
2061+
if (CS.solve(viable, FreeTypeVariableBinding::UnresolvedType))
20622062
return true;
20632063

20642064
auto &solution = viable[0];
@@ -2069,7 +2069,14 @@ bool TypeChecker::typeCheckCompletionSequence(Expr *&expr, DeclContext *DC) {
20692069
}
20702070

20712071
expr->setType(solution.simplifyType(expr->getType()));
2072-
CCE->setType(solution.simplifyType(CCE->getType()));
2072+
auto completionType = solution.simplifyType(CCE->getType());
2073+
2074+
// If completion expression is unresolved it doesn't provide
2075+
// any meaningful information so shouldn't be in the results.
2076+
if (completionType->is<UnresolvedType>())
2077+
return true;
2078+
2079+
CCE->setType(completionType);
20732080
return false;
20742081
}
20752082

lib/Sema/TypeChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ static Optional<Type> getTypeOfCompletionContextExpr(
853853

854854
Type originalType = parsedExpr->getType();
855855
if (auto T = TC.getTypeOfExpressionWithoutApplying(parsedExpr, DC,
856-
referencedDecl, FreeTypeVariableBinding::GenericParameters))
856+
referencedDecl, FreeTypeVariableBinding::UnresolvedType))
857857
return T;
858858

859859
// Try to recover if we've made any progress.

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ enum class FreeTypeVariableBinding {
305305
Disallow,
306306
/// Allow the free type variables to persist in the solution.
307307
Allow,
308-
/// Bind the type variables to fresh generic parameters.
309-
GenericParameters,
310308
/// Bind the type variables to UnresolvedType to represent the ambiguity.
311309
UnresolvedType
312310
};

test/IDE/complete_at_top_level.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ func resyncParser1() {}
151151

152152
fooObject#^TYPE_CHECKED_EXPR_1^#
153153
// TYPE_CHECKED_EXPR_1: Begin completions
154-
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{; name=.+$}}
155-
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{; name=.+$}}
156-
// TYPE_CHECKED_EXPR_1-NEXT: BuiltinOperator/None: = {#FooStruct#}[#Void#];
154+
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{; name=.+$}}
155+
// TYPE_CHECKED_EXPR_1-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{; name=.+$}}
156+
// TYPE_CHECKED_EXPR_1-NEXT:BuiltinOperator/None: = {#FooStruct#}[#Void#]; name== FooStruct
157157
// TYPE_CHECKED_EXPR_1-NEXT: End completions
158158

159159
func resyncParser2() {}
@@ -165,7 +165,7 @@ fooObject#^TYPE_CHECKED_EXPR_2^#
165165
// TYPE_CHECKED_EXPR_2: Begin completions
166166
// TYPE_CHECKED_EXPR_2-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{; name=.+$}}
167167
// TYPE_CHECKED_EXPR_2-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{; name=.+$}}
168-
// TYPE_CHECKED_EXPR_2-NEXT: BuiltinOperator/None: = {#FooStruct#}[#Void#];
168+
// TYPE_CHECKED_EXPR_2-NEXT: BuiltinOperator/None: = {#FooStruct#}[#Void#]; name== FooStruct
169169
// TYPE_CHECKED_EXPR_2-NEXT: End completions
170170

171171
func resyncParser3() {}
@@ -174,7 +174,7 @@ fooObject#^TYPE_CHECKED_EXPR_3^#.bar
174174
// TYPE_CHECKED_EXPR_3: Begin completions
175175
// TYPE_CHECKED_EXPR_3-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar[#Int#]{{; name=.+$}}
176176
// TYPE_CHECKED_EXPR_3-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc({#(a): Int#})[#Void#]{{; name=.+$}}
177-
// TYPE_CHECKED_EXPR_3-NEXT: BuiltinOperator/None: = {#FooStruct#}[#Void#];
177+
// TYPE_CHECKED_EXPR_3-NEXT: BuiltinOperator/None: = {#FooStruct#}[#Void#]; name== FooStruct
178178
// TYPE_CHECKED_EXPR_3-NEXT: End completions
179179

180180
func resyncParser4() {}

test/IDE/complete_enum_elements.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ enum BazEnum<T> {
197197
// BAZ_T_ENUM_NO_DOT: Begin completions
198198
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[EnumElement]/CurrNominal: .Baz1[#BazEnum<T>#]{{; name=.+$}}
199199
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[EnumElement]/CurrNominal: .Baz2({#T#})[#(T) -> BazEnum<T>#]{{; name=.+$}}
200-
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .bazInstanceFunc({#self: &BazEnum<T>#})[#() -> Void#]{{; name=.+$}}
200+
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .bazInstanceFunc({#self: &BazEnum<_>#})[#() -> Void#]{{; name=.+$}}
201201
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticVar]/CurrNominal: .staticVar[#Int#]{{; name=.+$}}
202-
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticVar]/CurrNominal: .staticVarT[#T#]{{; name=.+$}}
202+
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticVar]/CurrNominal: .staticVarT[#_#]{{; name=.+$}}
203203
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticMethod]/CurrNominal: .bazStaticFunc()[#Void#]{{; name=.+$}}
204204
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InfixOperatorFunction]/OtherModule[Swift]: == {#Any.Type?#}[#Bool#]; name=== Any.Type?
205205
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InfixOperatorFunction]/OtherModule[Swift]: != {#Any.Type?#}[#Bool#]; name=!= Any.Type?
@@ -217,9 +217,9 @@ enum BazEnum<T> {
217217
// BAZ_T_ENUM_DOT: Begin completions, 6 items
218218
// BAZ_T_ENUM_DOT-NEXT: Decl[EnumElement]/CurrNominal: Baz1[#BazEnum<T>#]{{; name=.+$}}
219219
// BAZ_T_ENUM_DOT-NEXT: Decl[EnumElement]/CurrNominal: Baz2({#T#})[#(T) -> BazEnum<T>#]{{; name=.+$}}
220-
// BAZ_T_ENUM_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: bazInstanceFunc({#self: &BazEnum<T>#})[#() -> Void#]{{; name=.+$}}
220+
// BAZ_T_ENUM_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: bazInstanceFunc({#self: &BazEnum<_>#})[#() -> Void#]{{; name=.+$}}
221221
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticVar]/CurrNominal: staticVar[#Int#]{{; name=.+$}}
222-
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticVar]/CurrNominal: staticVarT[#T#]{{; name=.+$}}
222+
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticVar]/CurrNominal: staticVarT[#_#]{{; name=.+$}}
223223
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticMethod]/CurrNominal: bazStaticFunc()[#Void#]{{; name=.+$}}
224224
// BAZ_T_ENUM_DOT-NEXT: End completions
225225

test/IDE/complete_from_swift_module.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ func testCompleteModuleQualified3() {
6363
foo_swift_module.BarGenericSwiftStruct1#^MODULE_QUALIFIED_3^#
6464
}
6565
// MODULE_QUALIFIED_3: Begin completions
66-
// MODULE_QUALIFIED_3-NEXT: Decl[Constructor]/CurrNominal: ({#t: T#})[#BarGenericSwiftStruct1<T>#]
67-
// MODULE_QUALIFIED_3-NEXT: Decl[InstanceMethod]/CurrNominal: .bar1InstanceFunc({#self: BarGenericSwiftStruct1<T>#})[#() -> Void#]{{; name=.+$}}
66+
// MODULE_QUALIFIED_3-NEXT: Decl[Constructor]/CurrNominal: ({#t: _#})[#BarGenericSwiftStruct1<_>#]; name=(t: _)
67+
// MODULE_QUALIFIED_3-NEXT: Decl[InstanceMethod]/CurrNominal: .bar1InstanceFunc({#self: BarGenericSwiftStruct1<_>#})[#() -> Void#]; name=bar1InstanceFunc(BarGenericSwiftStruct1<_>)
6868
// MODULE_QUALIFIED_3: Decl[InfixOperatorFunction]/OtherModule[Swift]: != {#Any.Type?#}[#Bool#];
6969
// MODULE_QUALIFIED_3: End completions
7070

7171
func testCompleteModuleQualified4() {
7272
foo_swift_module.BarGenericSwiftStruct2#^MODULE_QUALIFIED_4^#
7373
}
7474
// MODULE_QUALIFIED_4: Begin completions
75-
// MODULE_QUALIFIED_4-NEXT: Decl[Constructor]/CurrNominal: ({#t: BarProtocol#}, {#u: BarProtocol#})[#BarGenericSwiftStruct2<BarProtocol, BarProtocol>#]
76-
// MODULE_QUALIFIED_4-NEXT: Decl[InstanceMethod]/CurrNominal: .bar2InstanceFunc({#self: BarGenericSwiftStruct2<BarProtocol, BarProtocol>#})[#() -> Void#]
75+
// MODULE_QUALIFIED_4-NEXT: Decl[Constructor]/CurrNominal: ({#t: _#}, {#u: _#})[#BarGenericSwiftStruct2<_, _>#]; name=(t: _, u: _)
76+
// MODULE_QUALIFIED_4-NEXT: Decl[InstanceMethod]/CurrNominal: .bar2InstanceFunc({#self: BarGenericSwiftStruct2<_, _>#})[#() -> Void#]; name=bar2InstanceFunc(BarGenericSwiftStruct2<_, _>)
7777
// MODULE_QUALIFIED_4: Decl[InfixOperatorFunction]/OtherModule[Swift]: != {#Any.Type?#}[#Bool#];
7878
// MODULE_QUALIFIED_4-NEXT: End completions
7979

test/IDE/complete_operators.swift

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_8 | %FileCheck %s -check-prefix=S3_INFIX_OPTIONAL
3535
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_9 | %FileCheck %s -check-prefix=FOOABLE_INFIX
3636
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_10 | %FileCheck %s -check-prefix=FOOABLE_INFIX
37-
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_11 | %FileCheck %s -check-prefix=NO_OPERATORS
38-
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_12 | %FileCheck %s -check-prefix=NO_OPERATORS
37+
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_11 | %FileCheck %s -check-prefix=INFIX_11
38+
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_12 | %FileCheck %s -check-prefix=INFIX_12
3939
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_13 | %FileCheck %s -check-prefix=NO_OPERATORS
4040
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_14 | %FileCheck %s -check-prefix=NO_OPERATORS
41-
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_15 | %FileCheck %s -check-prefix=NO_OPERATORS
42-
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_16 | %FileCheck %s -check-prefix=NO_OPERATORS
41+
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_15 | %FileCheck %s -check-prefix=INFIX_15
42+
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_16 | %FileCheck %s -check-prefix=INFIX_16
4343
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_17 | %FileCheck %s -check-prefix=NO_OPERATORS
4444
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_18 | %FileCheck %s -check-prefix=NO_OPERATORS
4545
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_19 | %FileCheck %s -check-prefix=EMPTYCLASS_INFIX
4646
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_20 | %FileCheck %s -check-prefix=NO_OPERATORS
4747
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_21 | %FileCheck %s -check-prefix=NO_OPERATORS
48-
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_22 | %FileCheck %s -check-prefix=NO_OPERATORS
48+
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_22 | %FileCheck %s -check-prefix=INFIX_22
4949
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=S2_INFIX_SPACE | %FileCheck %s -check-prefix=S2_INFIX_SPACE
5050
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=EXT_INFIX_1 | %FileCheck %s -check-prefix=S2_INFIX
5151
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=EXT_INFIX_2 > %t.ext_infix_2
@@ -243,22 +243,41 @@ func testInfix10<T: P where T.T: Fooable>(x: T) {
243243
func testInfix11() {
244244
S2#^INFIX_11^#
245245
}
246-
// NO_OPERATORS-NOT: Decl[InfixOperatorFunction]
246+
// INFIX_11: Begin completions, 1 items
247+
// INFIX_11-DAG: Decl[Constructor]/CurrNominal: ()[#S2#]; name=()
248+
// INFIX_11: End completions
249+
247250
func testInfix12() {
248251
P#^INFIX_12^#
249252
}
253+
// INFIX_12: Begin completions, 2 items
254+
// INFIX_12-NEXT: Decl[AssociatedType]/CurrNominal: .T; name=T
255+
// INFIX_12-NEXT: Decl[InstanceMethod]/CurrNominal: .foo({#self: P#})[#() -> P.T#]; name=foo(P)
256+
// INFIX_12: End completions
257+
250258
func testInfix13() {
251259
P.foo#^INFIX_13^#
252260
}
261+
// NO_OPERATORS-NOT: Decl[InfixOperatorFunction]
262+
253263
func testInfix14() {
254264
P.T#^INFIX_14^#
255265
}
256266
func testInfix15<T: P where T.T == S2>() {
257267
T#^INFIX_15^#
258268
}
269+
// INFIX_15: Begin completions, 2 items
270+
// INFIX_15-NEXT: Decl[AssociatedType]/Super: .T; name=T
271+
// INFIX_15-NEXT: Decl[InstanceMethod]/Super: .foo({#self: P#})[#() -> S2#]; name=foo(P)
272+
// INFIX_15: End completions
273+
259274
func testInfix16<T: P where T.T == S2>() {
260275
T.foo#^INFIX_16^#
261276
}
277+
// INFIX_16: Begin completions, 1 items
278+
// INFIX_16-NEXT: Pattern/ExprSpecific: ({#(self): T#})[#() -> S2#]; name=(self: T)
279+
// INFIX_16: End completions
280+
262281
func testInfix17(x: Void) {
263282
x#^INFIX_17^#
264283
}
@@ -269,6 +288,7 @@ class EmptyClass {}
269288
func testInfix19(x: EmptyClass) {
270289
x#^INFIX_19^#
271290
}
291+
272292
// EMPTYCLASS_INFIX: Begin completions
273293
// EMPTYCLASS_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: === {#AnyObject?#}[#Bool#]
274294
// EMPTYCLASS_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: !== {#AnyObject?#}[#Bool#]
@@ -287,6 +307,9 @@ func testInfix21() {
287307
func testInfix22() {
288308
E.B#^INFIX_22^#
289309
}
310+
// INFIX_22: Begin completions, 1 items
311+
// INFIX_22-NEXT: Pattern/ExprSpecific: ({#S2#})[#E#]; name=(S2)
312+
// INFIX_22: End completions
290313

291314
func testSpace(x: S2) {
292315
x #^S2_INFIX_SPACE^#

test/IDE/complete_value_expr.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,8 +1266,8 @@ func testTypeCheckWithUnsolvedVariables1() {
12661266
}
12671267
// TC_UNSOLVED_VARIABLES_1: Begin completions
12681268
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceVar]/CurrNominal: count[#Int#]{{; name=.+$}}
1269-
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: addString({#(s): String#})[#BuilderStyle<T>#]{{; name=.+$}}
1270-
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: add({#(t): T#})[#BuilderStyle<T>#]{{; name=.+$}}
1269+
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: addString({#(s): String#})[#BuilderStyle<_>#]{{; name=.+$}}
1270+
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: add({#(t): _#})[#BuilderStyle<_>#]{{; name=.+$}}
12711271
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: get()[#Int#]{{; name=.+$}}
12721272
// TC_UNSOLVED_VARIABLES_1-NEXT: End completions
12731273

@@ -1276,8 +1276,8 @@ func testTypeCheckWithUnsolvedVariables2() {
12761276
}
12771277
// TC_UNSOLVED_VARIABLES_2: Begin completions
12781278
// TC_UNSOLVED_VARIABLES_2-NEXT: Decl[InstanceVar]/CurrNominal: count[#Int#]{{; name=.+$}}
1279-
// TC_UNSOLVED_VARIABLES_2-NEXT: Decl[InstanceMethod]/CurrNominal: addString({#(s): String#})[#BuilderStyle<T>#]{{; name=.+$}}
1280-
// TC_UNSOLVED_VARIABLES_2-NEXT: Decl[InstanceMethod]/CurrNominal: add({#(t): T#})[#BuilderStyle<T>#]{{; name=.+$}}
1279+
// TC_UNSOLVED_VARIABLES_2-NEXT: Decl[InstanceMethod]/CurrNominal: addString({#(s): String#})[#BuilderStyle<_>#]{{; name=.+$}}
1280+
// TC_UNSOLVED_VARIABLES_2-NEXT: Decl[InstanceMethod]/CurrNominal: add({#(t): _#})[#BuilderStyle<_>#]{{; name=.+$}}
12811281
// TC_UNSOLVED_VARIABLES_2-NEXT: Decl[InstanceMethod]/CurrNominal: get()[#Int#]{{; name=.+$}}
12821282
// TC_UNSOLVED_VARIABLES_2-NEXT: End completions
12831283

test/IDE/complete_vararg.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func testGenericFreeFunc() {
8989
genericFreeFunc1(#^GENERIC_FREE_FUNC_1^#
9090
}
9191
// GENERIC_FREE_FUNC_1: Begin completions, 1 items
92-
// GENERIC_FREE_FUNC_1: Pattern/ExprSpecific: ['(']{#t: τ_0_0...#})[#Void#]{{; name=.+$}}
92+
// GENERIC_FREE_FUNC_1: Pattern/ExprSpecific: ['(']{#t: _...#})[#Void#]{{; name=.+$}}
9393
// GENERIC_FREE_FUNC_1: End completions
9494

9595

test/SourceKit/CodeComplete/complete_structure.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func test9(_ x: inout Int) {
117117
// INT_INNER_0: {name:x==}
118118
// INT_INNER_0: {name:x<}
119119
// INT_INNER_0: {name:x+}
120-
// INT_INNER_0: {name:x>>}
121120
// INT_INNER_0: {name:x..<}
122121

123122
protocol P1 {

validation-test/IDE/crashers_2/0004-unmapped-dependent-type.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

validation-test/IDE/crashers_2/0007-archetype-not-in-context.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.

validation-test/IDE/crashers_2/0008-must-conform-to-literal-protocol.swift

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
3+
func _thread() {
4+
_ = #^A^#
5+
}
6+
7+
func run<InputCollection : Collection, Result>(_: InputCollection) -> Result {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
3+
class D<X, Y>() {}
4+
5+
class C<T> {
6+
func f<U>() -> D<U, T> {}
7+
func g() {
8+
f#^A^#
9+
}
10+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
3+
.a != nil #^A^#

0 commit comments

Comments
 (0)