Skip to content

Commit d21c280

Browse files
committed
[CSGen] Allow is pattern types to be holes
1 parent 70eeccb commit d21c280

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sema/CSGen.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,8 +2768,9 @@ namespace {
27682768
// correct handling of patterns like `_ as Foo` where `_` would
27692769
// get a type of `Foo` but `is` pattern enclosing it could still be
27702770
// inferred from enclosing context.
2771-
auto isType = CS.createTypeVariable(CS.getConstraintLocator(pattern),
2772-
TVO_CanBindToNoEscape);
2771+
auto isType =
2772+
CS.createTypeVariable(CS.getConstraintLocator(pattern),
2773+
TVO_CanBindToNoEscape | TVO_CanBindToHole);
27732774
CS.addConstraint(
27742775
ConstraintKind::Conversion, subPatternType, isType,
27752776
locator.withPathElement(LocatorPathElt::PatternMatch(pattern)));

0 commit comments

Comments
 (0)