@@ -2542,6 +2542,9 @@ static ConstraintFix *fixPropertyWrapperFailure(
2542
2542
if (baseTy->isEqual (type))
2543
2543
return nullptr ;
2544
2544
2545
+ if (baseTy->is <TypeVariableType>() || type->is <TypeVariableType>())
2546
+ return nullptr ;
2547
+
2545
2548
if (!attemptFix (*resolvedOverload, decl, type))
2546
2549
return nullptr ;
2547
2550
@@ -3286,24 +3289,6 @@ bool ConstraintSystem::repairFailures(
3286
3289
if (elt.getKind () != ConstraintLocator::ApplyArgToParam)
3287
3290
break ;
3288
3291
3289
- if (auto *fix = fixPropertyWrapperFailure (
3290
- *this , lhs, loc,
3291
- [&](SelectedOverload overload, VarDecl *decl, Type newBase) {
3292
- // FIXME: There is currently no easy way to avoid attempting
3293
- // fixes, matchTypes do not propagate `TMF_ApplyingFix` flag.
3294
- llvm::SaveAndRestore<ConstraintSystemOptions> options (
3295
- Options, Options - ConstraintSystemFlags::AllowFixes);
3296
-
3297
- TypeMatchOptions flags;
3298
- return matchTypes (newBase, rhs, ConstraintKind::Subtype, flags,
3299
- getConstraintLocator (locator))
3300
- .isSuccess ();
3301
- },
3302
- rhs)) {
3303
- conversionsOrFixes.push_back (fix);
3304
- break ;
3305
- }
3306
-
3307
3292
// If argument in l-value type and parameter is `inout` or a pointer,
3308
3293
// let's see if it's generic parameter matches and suggest adding explicit
3309
3294
// `&`.
@@ -3373,6 +3358,24 @@ bool ConstraintSystem::repairFailures(
3373
3358
}))
3374
3359
break ;
3375
3360
3361
+ if (auto *fix = fixPropertyWrapperFailure (
3362
+ *this , lhs, loc,
3363
+ [&](SelectedOverload overload, VarDecl *decl, Type newBase) {
3364
+ // FIXME: There is currently no easy way to avoid attempting
3365
+ // fixes, matchTypes do not propagate `TMF_ApplyingFix` flag.
3366
+ llvm::SaveAndRestore<ConstraintSystemOptions> options (
3367
+ Options, Options - ConstraintSystemFlags::AllowFixes);
3368
+
3369
+ TypeMatchOptions flags;
3370
+ return matchTypes (newBase, rhs, ConstraintKind::Subtype, flags,
3371
+ getConstraintLocator (locator))
3372
+ .isSuccess ();
3373
+ },
3374
+ rhs)) {
3375
+ conversionsOrFixes.push_back (fix);
3376
+ break ;
3377
+ }
3378
+
3376
3379
// If this is an implicit 'something-to-pointer' conversion
3377
3380
// it's going to be diagnosed by specialized fix which deals
3378
3381
// with generic argument mismatches.
0 commit comments