Skip to content

[ConstraintSolver] Forbid forming solutions with free generic type parameters #10021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/Sema/CSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ Solution ConstraintSystem::finalize(
solverState->BestScore = CurrentScore;
}

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

case FreeTypeVariableBinding::Allow:
break;

case FreeTypeVariableBinding::GenericParameters:
assignFixedType(tv, GenericTypeParamType::get(0, index++, TC.Context));
break;

case FreeTypeVariableBinding::UnresolvedType:
assignFixedType(tv, TC.Context.TheUnresolvedType);
Expand Down
11 changes: 9 additions & 2 deletions lib/Sema/TypeCheckConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ bool TypeChecker::typeCheckCompletionSequence(Expr *&expr, DeclContext *DC) {

// Attempt to solve the constraint system.
SmallVector<Solution, 4> viable;
if (CS.solve(viable, FreeTypeVariableBinding::GenericParameters))
if (CS.solve(viable, FreeTypeVariableBinding::UnresolvedType))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into this a little bit, code completion calls typeCheckCompletionSequence for each potential operators to decide whether they should be included into the code completion list. It seems this line change caused a solution that used to be unviable for "+" now becomes viable, thus + is considered as a viable code completion item. Any idea why this line change is less strict than before?

Copy link
Contributor Author

@xedin xedin Jun 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, the reason why + is returned in here is because + has multiple generic overloads and UnresolvedType is more permissive than GenericParameter, so what it's matching is -
Swift.(file).Strideable.+ : <Self where Self : Strideable> (Self.Type) -> (Self.Stride, Self) -> Self. I think I can tweak typeCheckCompletionSequence so if CCE is unresolved don't return it the solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, Thank you!

return true;

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

expr->setType(solution.simplifyType(expr->getType()));
CCE->setType(solution.simplifyType(CCE->getType()));
auto completionType = solution.simplifyType(CCE->getType());

// If completion expression is unresolved it doesn't provide
// any meaningful information so shouldn't be in the results.
if (completionType->is<UnresolvedType>())
return true;

CCE->setType(completionType);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static Optional<Type> getTypeOfCompletionContextExpr(

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

// Try to recover if we've made any progress.
Expand Down
2 changes: 0 additions & 2 deletions lib/Sema/TypeChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ enum class FreeTypeVariableBinding {
Disallow,
/// Allow the free type variables to persist in the solution.
Allow,
/// Bind the type variables to fresh generic parameters.
GenericParameters,
/// Bind the type variables to UnresolvedType to represent the ambiguity.
UnresolvedType
};
Expand Down
10 changes: 5 additions & 5 deletions test/IDE/complete_at_top_level.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ func resyncParser1() {}

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

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

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

func resyncParser4() {}
Expand Down
8 changes: 4 additions & 4 deletions test/IDE/complete_enum_elements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ enum BazEnum<T> {
// BAZ_T_ENUM_NO_DOT: Begin completions
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[EnumElement]/CurrNominal: .Baz1[#BazEnum<T>#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[EnumElement]/CurrNominal: .Baz2({#T#})[#(T) -> BazEnum<T>#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .bazInstanceFunc({#self: &BazEnum<T>#})[#() -> Void#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .bazInstanceFunc({#self: &BazEnum<_>#})[#() -> Void#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticVar]/CurrNominal: .staticVar[#Int#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticVar]/CurrNominal: .staticVarT[#T#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticVar]/CurrNominal: .staticVarT[#_#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[StaticMethod]/CurrNominal: .bazStaticFunc()[#Void#]{{; name=.+$}}
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InfixOperatorFunction]/OtherModule[Swift]: == {#Any.Type?#}[#Bool#]; name=== Any.Type?
// BAZ_T_ENUM_NO_DOT-NEXT: Decl[InfixOperatorFunction]/OtherModule[Swift]: != {#Any.Type?#}[#Bool#]; name=!= Any.Type?
Expand All @@ -217,9 +217,9 @@ enum BazEnum<T> {
// BAZ_T_ENUM_DOT: Begin completions, 6 items
// BAZ_T_ENUM_DOT-NEXT: Decl[EnumElement]/CurrNominal: Baz1[#BazEnum<T>#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[EnumElement]/CurrNominal: Baz2({#T#})[#(T) -> BazEnum<T>#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: bazInstanceFunc({#self: &BazEnum<T>#})[#() -> Void#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: bazInstanceFunc({#self: &BazEnum<_>#})[#() -> Void#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticVar]/CurrNominal: staticVar[#Int#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticVar]/CurrNominal: staticVarT[#T#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticVar]/CurrNominal: staticVarT[#_#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: Decl[StaticMethod]/CurrNominal: bazStaticFunc()[#Void#]{{; name=.+$}}
// BAZ_T_ENUM_DOT-NEXT: End completions

Expand Down
8 changes: 4 additions & 4 deletions test/IDE/complete_from_swift_module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ func testCompleteModuleQualified3() {
foo_swift_module.BarGenericSwiftStruct1#^MODULE_QUALIFIED_3^#
}
// MODULE_QUALIFIED_3: Begin completions
// MODULE_QUALIFIED_3-NEXT: Decl[Constructor]/CurrNominal: ({#t: T#})[#BarGenericSwiftStruct1<T>#]
// MODULE_QUALIFIED_3-NEXT: Decl[InstanceMethod]/CurrNominal: .bar1InstanceFunc({#self: BarGenericSwiftStruct1<T>#})[#() -> Void#]{{; name=.+$}}
// MODULE_QUALIFIED_3-NEXT: Decl[Constructor]/CurrNominal: ({#t: _#})[#BarGenericSwiftStruct1<_>#]; name=(t: _)
// MODULE_QUALIFIED_3-NEXT: Decl[InstanceMethod]/CurrNominal: .bar1InstanceFunc({#self: BarGenericSwiftStruct1<_>#})[#() -> Void#]; name=bar1InstanceFunc(BarGenericSwiftStruct1<_>)
// MODULE_QUALIFIED_3: Decl[InfixOperatorFunction]/OtherModule[Swift]: != {#Any.Type?#}[#Bool#];
// MODULE_QUALIFIED_3: End completions

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

Expand Down
35 changes: 29 additions & 6 deletions test/IDE/complete_operators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_8 | %FileCheck %s -check-prefix=S3_INFIX_OPTIONAL
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_9 | %FileCheck %s -check-prefix=FOOABLE_INFIX
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_10 | %FileCheck %s -check-prefix=FOOABLE_INFIX
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_11 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_12 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_11 | %FileCheck %s -check-prefix=INFIX_11
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_12 | %FileCheck %s -check-prefix=INFIX_12
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_13 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_14 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_15 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_16 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_15 | %FileCheck %s -check-prefix=INFIX_15
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_16 | %FileCheck %s -check-prefix=INFIX_16
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_17 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_18 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_19 | %FileCheck %s -check-prefix=EMPTYCLASS_INFIX
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_20 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_21 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_22 | %FileCheck %s -check-prefix=NO_OPERATORS
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=INFIX_22 | %FileCheck %s -check-prefix=INFIX_22
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=S2_INFIX_SPACE | %FileCheck %s -check-prefix=S2_INFIX_SPACE
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=EXT_INFIX_1 | %FileCheck %s -check-prefix=S2_INFIX
// RUN: %target-swift-ide-test -code-completion -source-filename=%s -code-completion-token=EXT_INFIX_2 > %t.ext_infix_2
Expand Down Expand Up @@ -243,22 +243,41 @@ func testInfix10<T: P where T.T: Fooable>(x: T) {
func testInfix11() {
S2#^INFIX_11^#
}
// NO_OPERATORS-NOT: Decl[InfixOperatorFunction]
// INFIX_11: Begin completions, 1 items
// INFIX_11-DAG: Decl[Constructor]/CurrNominal: ()[#S2#]; name=()
// INFIX_11: End completions

func testInfix12() {
P#^INFIX_12^#
}
// INFIX_12: Begin completions, 2 items
// INFIX_12-NEXT: Decl[AssociatedType]/CurrNominal: .T; name=T
// INFIX_12-NEXT: Decl[InstanceMethod]/CurrNominal: .foo({#self: P#})[#() -> P.T#]; name=foo(P)
// INFIX_12: End completions

func testInfix13() {
P.foo#^INFIX_13^#
}
// NO_OPERATORS-NOT: Decl[InfixOperatorFunction]

func testInfix14() {
P.T#^INFIX_14^#
}
func testInfix15<T: P where T.T == S2>() {
T#^INFIX_15^#
}
// INFIX_15: Begin completions, 2 items
// INFIX_15-NEXT: Decl[AssociatedType]/Super: .T; name=T
// INFIX_15-NEXT: Decl[InstanceMethod]/Super: .foo({#self: P#})[#() -> S2#]; name=foo(P)
// INFIX_15: End completions

func testInfix16<T: P where T.T == S2>() {
T.foo#^INFIX_16^#
}
// INFIX_16: Begin completions, 1 items
// INFIX_16-NEXT: Pattern/ExprSpecific: ({#(self): T#})[#() -> S2#]; name=(self: T)
// INFIX_16: End completions

func testInfix17(x: Void) {
x#^INFIX_17^#
}
Expand All @@ -269,6 +288,7 @@ class EmptyClass {}
func testInfix19(x: EmptyClass) {
x#^INFIX_19^#
}

// EMPTYCLASS_INFIX: Begin completions
// EMPTYCLASS_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: === {#AnyObject?#}[#Bool#]
// EMPTYCLASS_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: !== {#AnyObject?#}[#Bool#]
Expand All @@ -287,6 +307,9 @@ func testInfix21() {
func testInfix22() {
E.B#^INFIX_22^#
}
// INFIX_22: Begin completions, 1 items
// INFIX_22-NEXT: Pattern/ExprSpecific: ({#S2#})[#E#]; name=(S2)
// INFIX_22: End completions

func testSpace(x: S2) {
x #^S2_INFIX_SPACE^#
Expand Down
8 changes: 4 additions & 4 deletions test/IDE/complete_value_expr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1266,8 +1266,8 @@ func testTypeCheckWithUnsolvedVariables1() {
}
// TC_UNSOLVED_VARIABLES_1: Begin completions
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceVar]/CurrNominal: count[#Int#]{{; name=.+$}}
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: addString({#(s): String#})[#BuilderStyle<T>#]{{; name=.+$}}
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: add({#(t): T#})[#BuilderStyle<T>#]{{; name=.+$}}
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: addString({#(s): String#})[#BuilderStyle<_>#]{{; name=.+$}}
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: add({#(t): _#})[#BuilderStyle<_>#]{{; name=.+$}}
// TC_UNSOLVED_VARIABLES_1-NEXT: Decl[InstanceMethod]/CurrNominal: get()[#Int#]{{; name=.+$}}
// TC_UNSOLVED_VARIABLES_1-NEXT: End completions

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

Expand Down
2 changes: 1 addition & 1 deletion test/IDE/complete_vararg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func testGenericFreeFunc() {
genericFreeFunc1(#^GENERIC_FREE_FUNC_1^#
}
// GENERIC_FREE_FUNC_1: Begin completions, 1 items
// GENERIC_FREE_FUNC_1: Pattern/ExprSpecific: ['(']{#t: τ_0_0...#})[#Void#]{{; name=.+$}}
// GENERIC_FREE_FUNC_1: Pattern/ExprSpecific: ['(']{#t: _...#})[#Void#]{{; name=.+$}}
// GENERIC_FREE_FUNC_1: End completions


Expand Down
1 change: 0 additions & 1 deletion test/SourceKit/CodeComplete/complete_structure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func test9(_ x: inout Int) {
// INT_INNER_0: {name:x==}
// INT_INNER_0: {name:x<}
// INT_INNER_0: {name:x+}
// INT_INNER_0: {name:x>>}
// INT_INNER_0: {name:x..<}

protocol P1 {
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions validation-test/IDE/crashers_2/0007-archetype-not-in-context.swift

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s

func _thread() {
_ = #^A^#
}

func run<InputCollection : Collection, Result>(_: InputCollection) -> Result {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s

class D<X, Y>() {}

class C<T> {
func f<U>() -> D<U, T> {}
func g() {
f#^A^#
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s

.a != nil #^A^#