Skip to content

Commit 00c98ef

Browse files
committed
Revert "[Type checker] Recurse into statements when cleaning type variables."
This reverts commit 45db3e3.
1 parent f19c4af commit 00c98ef

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,12 @@ void CleanupIllFormedExpressionRAII::doIt(Expr *expr, ASTContext &Context) {
13011301
}
13021302
return true;
13031303
}
1304+
1305+
// Don't walk into statements. This handles the BraceStmt in
1306+
// non-single-expr closures, so we don't walk into their body.
1307+
std::pair<bool, Stmt *> walkToStmtPre(Stmt *S) override {
1308+
return { false, S };
1309+
}
13041310
};
13051311

13061312
if (expr)

validation-test/compiler_crashers_fixed/28413-swift-typebase-getcanonicaltype.swift renamed to validation-test/compiler_crashers/28413-swift-typebase-getcanonicaltype.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// See http://swift.org/LICENSE.txt for license information
66
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -parse
8+
// RUN: not --crash %target-swift-frontend %s -parse
99
t c
1010
let : {{
1111
return $0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// See http://swift.org/LICENSE.txt for license information
66
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// RUN: not --crash %target-swift-frontend %s -emit-ir
99
guard{{return $0
1010
== Int
1111
p

0 commit comments

Comments
 (0)