Skip to content

Commit eb78182

Browse files
authored
Merge pull request #6510 from xedin/crasher-28592
[QoI] Fix recursive propagation of materializability to look through optional types
2 parents 053ca89 + 8c4b871 commit eb78182

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ void ConstraintSystem::setMustBeMaterializableRecursive(Type type)
147147
"argument to setMustBeMaterializableRecursive may not be inherently "
148148
"non-materializable");
149149
type = getFixedTypeRecursive(type, /*wantRValue=*/false);
150+
type = type->lookThroughAllAnyOptionalTypes();
151+
150152
if (auto typeVar = type->getAs<TypeVariableType>()) {
151153
typeVar->getImpl().setMustBeMaterializable(getSavedBindings());
152154
} else if (auto *tupleTy = type->getAs<TupleType>()) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +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 --crash %target-swift-frontend %s -emit-ir
8+
// RUN: not %target-swift-frontend %s -emit-ir
99
// REQUIRES: asserts
1010
[_._?
1111
&_

0 commit comments

Comments
 (0)