File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2277,10 +2277,13 @@ namespace {
2277
2277
getTypeForPattern (
2278
2278
cast<VarPattern>(pattern)->getSubPattern (), locator,
2279
2279
externalPatternType, bindPatternVarsOneWay));
2280
+
2280
2281
case PatternKind::Any: {
2281
2282
return setType (
2282
- CS.createTypeVariable (CS.getConstraintLocator (locator),
2283
- TVO_CanBindToNoEscape));
2283
+ externalPatternType
2284
+ ? externalPatternType
2285
+ : CS.createTypeVariable (CS.getConstraintLocator (locator),
2286
+ TVO_CanBindToNoEscape));
2284
2287
}
2285
2288
2286
2289
case PatternKind::Named: {
@@ -2382,7 +2385,7 @@ namespace {
2382
2385
Type subPatternType = getTypeForPattern (
2383
2386
subPattern,
2384
2387
locator.withPathElement (LocatorPathElt::PatternMatch (subPattern)),
2385
- Type () , bindPatternVarsOneWay);
2388
+ openedType , bindPatternVarsOneWay);
2386
2389
2387
2390
CS.addConstraint (
2388
2391
ConstraintKind::Conversion, subPatternType, openedType,
You can’t perform that action at this time.
0 commit comments