/-
Copyright (c) 2023 Kyle Miller. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kyle Miller, Thomas R. Murrills
-/
module
public import Mathlib.Init
meta import Lean.Elab.Term
set_option doc.verso true
set_option doc.verso.suggestions false
/-!
# Additions to `Lean.Elab.Term`
-/
public meta section
namespace Lean.Elab.Term
/-- Fully elaborates the term `patt`, allowing typeclass inference failure,
but while setting `errToSorry` to false.
Typeclass failures result in plain metavariables.
Instantiates all assigned metavariables. -/
def elabPattern (patt : Term) (expectedType? : Option Expr) : TermElabM Expr := do
withTheReader Term.Context ({ · with ignoreTCFailures := true, errToSorry := false }) <|
withSynthesizeLight do
let t ← elabTerm patt expectedType?
synthesizeSyntheticMVars (postpone := .no) (ignoreStuckTC := true)
instantiateMVars t
end Lean.Elab.Term
¤ Dauer der Verarbeitung: 0.3 Sekunden
¤
*© Formatika GbR, Deutschland