lean4-htt/tests/pkg/prv/Prv.lean
jrr6 4759506bcf
chore: use note and hint' for message addenda (#8980)
This PR improves the consistency of error message formatting by
rendering addenda of several existing error messages as labeled notes
and hints.
2025-06-27 15:16:01 +00:00

31 lines
854 B
Text

import Prv.Foo
#check { name := "leo", val := 15 : Foo }
#check { name := "leo", val := 15 : Foo }.name
/-- error: Field `val` from structure `Foo` is private -/
#guard_msgs in
#check { name := "leo", val := 15 : Foo }.val
/-- error: unknown identifier 'a' -/
#guard_msgs in
#check a
/--
error: overloaded, errors ⏎
failed to synthesize
EmptyCollection (Name "hello")
Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.
invalid {...} notation, constructor for 'Name' is marked as private
-/
#guard_msgs in
def m1 : Name "hello" := {}
/-- error: invalid ⟨...⟩ notation, constructor for `Name` is marked as private -/
#guard_msgs in
def m2 : Name "hello" := ⟨"hello"⟩
/-- error: unknown constant 'Name.mk' -/
#guard_msgs in
def m3 : Name "hello" := Name.mk "hello"