mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #42146 from xedin/rdar-91145060
[ConstraintSystem] Cache types of `~=` components
This commit is contained in:
@@ -8944,6 +8944,9 @@ static bool inferEnumMemberThroughTildeEqualsOperator(
|
||||
|
||||
std::tie(matchVar, matchCall) = *tildeEqualsApplication;
|
||||
|
||||
cs.setType(matchVar, enumTy);
|
||||
cs.setType(EP, enumTy);
|
||||
|
||||
// result of ~= operator is always a `Bool`.
|
||||
auto target = SolutionApplicationTarget::forExprPattern(
|
||||
matchCall, DC, EP, ctx.getBoolDecl()->getDeclaredInterfaceType());
|
||||
@@ -8972,7 +8975,6 @@ static bool inferEnumMemberThroughTildeEqualsOperator(
|
||||
// Store the $match variable and binary expression for solution application.
|
||||
EP->setMatchVar(matchVar);
|
||||
EP->setMatchExpr(matchCall);
|
||||
EP->setType(enumTy);
|
||||
|
||||
cs.setSolutionApplicationTarget(pattern, target);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user