@@ -2129,8 +2129,9 @@ namespace {
21292129 // Now that we know we're actually going to use the type, get the
21302130 // version for use in a constraint.
21312131 contextualType = CS.getContextualType (expr, /* forConstraint=*/ true );
2132+ // FIXME: This is the wrong place to be opening the opaque type.
21322133 contextualType = CS.openOpaqueType (
2133- contextualType, contextualPurpose, locator);
2134+ contextualType, contextualPurpose, locator, /* ownerDecl= */ nullptr );
21342135 Type arrayElementType = contextualType->isArrayType ();
21352136 CS.addConstraint (ConstraintKind::LiteralConformsTo, contextualType,
21362137 arrayProto->getDeclaredInterfaceType (),
@@ -2242,8 +2243,10 @@ namespace {
22422243 // Now that we know we're actually going to use the type, get the
22432244 // version for use in a constraint.
22442245 contextualType = CS.getContextualType (expr, /* forConstraint=*/ true );
2246+ // FIXME: This is the wrong place to be opening the opaque type.
22452247 auto openedType =
2246- CS.openOpaqueType (contextualType, contextualPurpose, locator);
2248+ CS.openOpaqueType (contextualType, contextualPurpose, locator,
2249+ /* ownerDecl=*/ nullptr );
22472250 auto dictionaryKeyValue =
22482251 ConstraintSystem::isDictionaryType (openedType);
22492252 Type contextualDictionaryKeyType;
@@ -2814,7 +2817,8 @@ namespace {
28142817
28152818 Type replacedType = CS.replaceInferableTypesWithTypeVars (type, locator);
28162819 Type openedType =
2817- CS.openOpaqueType (replacedType, CTP_Initialization, locator);
2820+ CS.openOpaqueType (replacedType, CTP_Initialization, locator,
2821+ patternBinding);
28182822 assert (openedType);
28192823
28202824 auto *subPattern = cast<TypedPattern>(pattern)->getSubPattern ();
0 commit comments