Skip to content

Commit 72f2e7a

Browse files
authored
feat: make structure type clickable in “not a field” error (#5072)
1 parent cd21687 commit 72f2e7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Lean/Elab/StructInst.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Lean.Parser.Term
99
import Lean.Meta.Structure
1010
import Lean.Elab.App
1111
import Lean.Elab.Binders
12+
import Lean.PrettyPrinter
1213

1314
namespace Lean.Elab.Term.StructInst
1415

@@ -433,7 +434,7 @@ private def expandParentFields (s : Struct) : TermElabM Struct := do
433434
| { lhs := .fieldName ref fieldName :: _, .. } =>
434435
addCompletionInfo <| CompletionInfo.fieldId ref fieldName (← getLCtx) s.structName
435436
match findField? env s.structName fieldName with
436-
| none => throwErrorAt ref "'{fieldName}' is not a field of structure '{s.structName}'"
437+
| none => throwErrorAt ref "'{fieldName}' is not a field of structure '{MessageData.ofConstName s.structName}'"
437438
| some baseStructName =>
438439
if baseStructName == s.structName then pure field
439440
else match getPathToBaseStructure? env baseStructName s.structName with

0 commit comments

Comments
 (0)