Skip to content

Commit 116b239

Browse files
authored
Merge pull request #6794 from apple/revert-6780-keypath-crashers
2 parents c501812 + e46e63e commit 116b239

12 files changed

+23
-24
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,6 @@ bool ConstraintSystem::Candidate::solve() {
14531453
// because it would assign types to expressions, which
14541454
// might interfere with solving higher-level expressions.
14551455
ExprCleaner cleaner(E);
1456-
CleanupIllFormedExpressionRAII cleanup(TC.Context, E);
14571456

14581457
// Allocate new constraint system for sub-expression.
14591458
ConstraintSystem cs(TC, DC, None);
@@ -1496,18 +1495,6 @@ bool ConstraintSystem::Candidate::solve() {
14961495

14971496
// Record found solutions as suggestions.
14981497
this->applySolutions(solutions);
1499-
1500-
// Solution application is going to modify AST, so we need to avoid
1501-
// clean-up, but let's double-check if we have any implicit
1502-
// expressions with type variables and nullify their types.
1503-
cleanup.disable();
1504-
E->forEachChildExpr([&](Expr *childExpr) -> Expr * {
1505-
Type type = childExpr->getType();
1506-
if (childExpr->isImplicit() && type && type->hasTypeVariable())
1507-
childExpr->setType(Type());
1508-
return childExpr;
1509-
});
1510-
15111498
return false;
15121499
}
15131500

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

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
[{_=#keyPath(t>w
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
f#keyPath(n&_==a>c{{{{{{{{{{{{{{{{{_=b:{{{{c{{{{{{d
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
[{{{{{{{{{{{{{{0=#keyPath(n&_=d
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8+
// REQUIRES: deterministic-behavior
89
// REQUIRES: asserts
9-
// RUN: not %target-swift-frontend %s -emit-ir
10+
// RUN: not --crash %target-swift-frontend %s -emit-ir
1011

1112
{func a>
1213
print(a==#keyPath(a{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// REQUIRES: deterministic-behavior
10+
// RUN: not --crash %target-swift-frontend %s -emit-ir
911
func a|Set(#keyPath(t>a>a{
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
print([{#keyPath(a}(t>A
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
protocol a func a|Set(#keyPath(t>a{

validation-test/compiler_crashers_fixed/28641-result-case-not-implemented.swift renamed to validation-test/compiler_crashers/28641-result-case-not-implemented.swift

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

8+
// REQUIRES: deterministic-behavior
89
// REQUIRES: asserts
9-
// RUN: not %target-swift-frontend %s -emit-ir
10+
// RUN: not --crash %target-swift-frontend %s -emit-ir
1011
{let β=b&[{{{#keyPath(n&[{{{{{{{{{{{{{{{{{{{{{{{{{{a{{{{s

validation-test/compiler_crashers_fixed/28642-swift-optionaltype-get-swift-type.swift renamed to validation-test/compiler_crashers/28642-swift-optionaltype-get-swift-type.swift

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

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
Array(_==#keyPath(t>Void!
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
(.n).h.n&[(#keyPath(t>A

validation-test/compiler_crashers_fixed/28646-swift-lvaluetype-get-swift-type.swift renamed to validation-test/compiler_crashers/28646-swift-lvaluetype-get-swift-type.swift

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

8-
// RUN: not %target-swift-frontend %s -emit-ir
8+
// REQUIRES: deterministic-behavior
9+
// RUN: not --crash %target-swift-frontend %s -emit-ir
910
#keyPath(a
1011
print(Int
1112
print(_=#keyPath(a

0 commit comments

Comments
 (0)