chore: use withAssignableSyntheticOpaque

This commit is contained in:
Leonardo de Moura 2022-07-06 13:55:57 -07:00
parent 608a306ef0
commit ec4794ad10
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ def elabTermEnsuringType (stx : Syntax) (expectedType? : Option Expr) (mayPostpo
let eType ← inferType e
-- We allow synthetic opaque metavars to be assigned in the following step since the `isDefEq` is not really
-- part of the elaboration, but part of the tactic. See issue #492
unless (← withAssignableSyntheticOpaque do isDefEq eType expectedType) do
unless (← withAssignableSyntheticOpaque <| isDefEq eType expectedType) do
Term.throwTypeMismatchError none expectedType eType e
return e

View file

@ -127,7 +127,7 @@ partial def mkElimApp (elimInfo : ElimInfo) (targets : Array Expr) (tag : Name)
throwError "insufficient number of targets for '{elimInfo.name}'"
let target := ctx.targets[s.targetPos]!
let expectedType ← getArgExpectedType
let target ← withConfig (fun cfg => { cfg with assignSyntheticOpaque := true }) do Term.ensureHasType expectedType target
let target ← withAssignableSyntheticOpaque <| Term.ensureHasType expectedType target
modify fun s => { s with targetPos := s.targetPos + 1 }
addNewArg target
else match c.binderInfo with