Skip to content

Commit 92009e1

Browse files
committed
refactor: style
1 parent 4d59e2d commit 92009e1

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/Lean/Elab/App.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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}\nhas type{indentExpr eType}"
1151-
11521149
private def throwLValErrorAt (ref : Syntax) (e : Expr) (eType : Expr) (msg : MessageData) : TermElabM α :=
11531150
throwErrorAt ref "{msg}{indentExpr e}\nhas 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`.
11571157
If it resolves to `name`, returns `(S', name)`.

src/Lean/Exception.lean

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,21 @@ See also `mkUnknownIdentifierMessage`.
9898
def 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+
-/
102106
def 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+
-/
107114
def throwUnknownConstant [Monad m] [MonadError m] (constName : Name) : m α := do
108-
throwUnknownIdentifierAt (← getRef) m!"unknown constant '{.ofConstName constName}'"
115+
throwUnknownConstantAt (← getRef) constName
109116

110117
/--
111118
Convert an `Except` into a `m` monadic action, where `m` is any monad that

0 commit comments

Comments
 (0)