Skip to content

Commit f19c4af

Browse files
committed
Revert "[Type checker] Recurse into statements when cleaning type variables, harder."
This reverts commit 01913be.
1 parent fbd5369 commit f19c4af

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Sema/ConstraintSystem.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,12 @@ class ExprCleaner {
24112411
TS->Patterns.insert({ P, P->getType() });
24122412
return { true, P };
24132413
}
2414+
2415+
// Don't walk into statements. This handles the BraceStmt in
2416+
// non-single-expr closures, so we don't walk into their body.
2417+
std::pair<bool, Stmt *> walkToStmtPre(Stmt *S) override {
2418+
return { false, S };
2419+
}
24142420
};
24152421

24162422
E->walk(ExprCleanserImpl(this));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
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
b<n([print{$0

0 commit comments

Comments
 (0)