File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -1146,12 +1146,12 @@ inductive LValResolution where
11461146 The `fullName` is the name of the recursive function, and `baseName` is the base name of the type to search for in the parameter list. -/
11471147 | localRec (baseName : Name) (fullName : Name) (fvar : Expr)
11481148
1149- private def throwLValError (e : Expr) (eType : Expr) (msg : MessageData) : TermElabM α :=
1150- throwError "{msg}{indentExpr e}\n has type{indentExpr eType}"
1151-
11521149private def throwLValErrorAt (ref : Syntax) (e : Expr) (eType : Expr) (msg : MessageData) : TermElabM α :=
11531150 throwErrorAt ref "{msg}{indentExpr e}\n has type{indentExpr eType}"
11541151
1152+ private def throwLValError (e : Expr) (eType : Expr) (msg : MessageData) : TermElabM α := do
1153+ throwLValErrorAt (← getRef) e eType msg
1154+
11551155/--
11561156`findMethod? S fName` tries the for each namespace `S'` in the resolution order for `S` to resolve the name `S'.fname`.
11571157If it resolves to `name`, returns `(S', name)`.
Original file line number Diff line number Diff line change @@ -98,14 +98,21 @@ See also `mkUnknownIdentifierMessage`.
9898def throwUnknownIdentifierAt [Monad m] [MonadError m] (ref : Syntax) (msg : MessageData) : m α :=
9999 Lean.throwErrorAt ref <| mkUnknownIdentifierMessage msg
100100
101- /-- Throw an unknown constant error message. -/
101+ /--
102+ Throw an unknown constant error message.
103+ The end position of the range of `ref` should point at the unknown identifier.
104+ See also `mkUnknownIdentifierMessage`.
105+ -/
102106def throwUnknownConstantAt [Monad m] [MonadError m] (ref : Syntax) (constName : Name) : m α := do
103107 throwUnknownIdentifierAt ref m!"unknown constant '{.ofConstName constName}'"
104108
105- /-- Throw an unknown constant error message. -/
106- @[deprecated throwUnknownConstantAt (since := "2025-05-16")]
109+ /--
110+ Throw an unknown constant error message.
111+ The end position of the range of the current reference should point at the unknown identifier.
112+ See also `mkUnknownIdentifierMessage`.
113+ -/
107114def throwUnknownConstant [Monad m] [MonadError m] (constName : Name) : m α := do
108- throwUnknownIdentifierAt (← getRef) m! "unknown constant '{.ofConstName constName}'"
115+ throwUnknownConstantAt (← getRef) constName
109116
110117/--
111118Convert an `Except` into a `m` monadic action, where `m` is any monad that
You can’t perform that action at this time.
0 commit comments