Skip to content

Commit f2e581c

Browse files
committed
[Type checker] Look through reference storage types for typed patterns.
Fixes a regression caused by properly setting the context for checking the type in a typed pattern.
1 parent 3abea6b commit f2e581c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/CSGen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,10 @@ namespace {
23282328
: ContextualPattern::forRawPattern(pattern, CurDC);
23292329

23302330
Type type = TypeChecker::typeCheckPattern(contextualPattern);
2331+
2332+
// Look through reference storage types.
2333+
type = type->getReferenceStorageReferent();
2334+
23312335
Type openedType = CS.openUnboundGenericType(type, locator);
23322336

23332337
// Determine the subpattern type. It will be convertible to the

0 commit comments

Comments
 (0)