refactor: use coercion meta API
This commit is contained in:
parent
05401776f2
commit
8a48a8f119
1 changed files with 3 additions and 5 deletions
|
|
@ -197,11 +197,9 @@ where
|
|||
|
||||
-- Auxiliary function used at `analyze`
|
||||
private def hasCoe (fromType toType : Expr) : TermElabM Bool := do
|
||||
if (← getEnv).contains ``CoeHTCT then
|
||||
let u ← getLevel fromType
|
||||
let v ← getLevel toType
|
||||
let coeInstType := mkAppN (Lean.mkConst ``CoeHTCT [u, v]) #[fromType, toType]
|
||||
match ← trySynthInstance coeInstType (some (maxCoeSize.get (← getOptions))) with
|
||||
if (← getEnv).contains ``CoeT then
|
||||
withLocalDeclD `x fromType fun x => do
|
||||
match ← coerceSimple? x toType with
|
||||
| .some _ => return true
|
||||
| .none => return false
|
||||
| .undef => return false -- TODO: should we do something smarter here?
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue