Skip to content

Commit

Permalink
[CSSimplify] Repair should ignore situations where assignment source …
Browse files Browse the repository at this point in the history
…or destination are a hole

If either source or destination type is a hole conversion should
just be ignored because there is no r-value or other mismatch that
could be diagnosed in this case.
  • Loading branch information
xedin committed Jul 24, 2023
1 parent 9e388b4 commit b8915fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Sema/CSSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5350,6 +5350,11 @@ bool ConstraintSystem::repairFailures(
if (repairByUsingRawValueOfRawRepresentableType(lhs, rhs))
return true;

// If either side is a placeholder then let's consider this
// assignment correctly typed.
if (lhs->isPlaceholder() || rhs->isPlaceholder())
return true;

// Let's try to match source and destination types one more
// time to see whether they line up, if they do - the problem is
// related to immutability, otherwise it's a type mismatch.
Expand Down

0 comments on commit b8915fa

Please sign in to comment.