fix: do not create coercion placeholder if function is partially applied
This commit is contained in:
parent
645c3e777d
commit
c5e00c2bde
1 changed files with 5 additions and 3 deletions
|
|
@ -349,11 +349,13 @@ private def finalize : M Expr := do
|
|||
from test `948.lean`. There are multiple ways to infer `X`, and we don't want to mark it as `syntheticOpaque`.
|
||||
-/
|
||||
if let some outParamMVarId := s.resultTypeOutParam? then
|
||||
if (← isExprMVarAssigned outParamMVarId) then
|
||||
pure false
|
||||
else
|
||||
/- If `eType != mkMVar outParamMVarId`, then the
|
||||
function is partially applied, and we do not create coercion placeholder. -/
|
||||
if !(← isExprMVarAssigned outParamMVarId) && eType.isMVar && eType.mvarId! == outParamMVarId then
|
||||
setMVarKind outParamMVarId .syntheticOpaque
|
||||
pure true
|
||||
else
|
||||
pure false
|
||||
else
|
||||
pure false
|
||||
if shouldCreateCoe then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue