Skip to content

Commit 87750ac

Browse files
authored
Merge pull request #3689 from benlangmuir/clear-typevariabletypes
2 parents bfbe8f8 + e4b27cd commit 87750ac

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3085,6 +3085,7 @@ bool swift::typeCheckUnresolvedExpr(DeclContext &DC,
30853085
ConstraintSystemOptions Options = ConstraintSystemFlags::AllowFixes;
30863086
auto *TC = static_cast<TypeChecker*>(DC.getASTContext().getLazyResolver());
30873087
ConstraintSystem CS(*TC, &DC, Options);
3088+
CleanupIllFormedExpressionRAII cleanup(TC->Context, Parent);
30883089
InferUnresolvedMemberConstraintGenerator MCG(E, CS);
30893090
ConstraintWalker cw(MCG);
30903091
Parent->walk(cw);

test/IDE/complete_unresolved_members.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_25 | FileCheck %s -check-prefix=UNRESOLVED_3
3131
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_26 | FileCheck %s -check-prefix=UNRESOLVED_3
3232
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_27 | FileCheck %s -check-prefix=UNRESOLVED_3
33+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_27_NOCRASH > /dev/null
3334
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_28 | FileCheck %s -check-prefix=UNRESOLVED_1
3435
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_29 | FileCheck %s -check-prefix=UNRESOLVED_1
3536
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNRESOLVED_30 | FileCheck %s -check-prefix=UNRESOLVED_2
@@ -241,12 +242,12 @@ extension C7 {
241242
var cInst1 = C7()
242243
cInst1.extendedf1(.#^UNRESOLVED_26^#
243244

244-
245-
// This #if works around:
246-
// <rdar://problem/26057202> Crash in code completion on invalid input
247-
#if false
248-
#endif
249-
245+
func nocrash1() -> SomeEnum1 {
246+
return .#^UNRESOLVED_27_NOCRASH^#
247+
}
248+
249+
func resetParser1() {}
250+
250251
func f() -> SomeEnum1 {
251252
return .#^UNRESOLVED_27^#
252253
}

0 commit comments

Comments
 (0)