lean4-htt/tests/pkg/prv/Prv.lean
jrr6 fa1da03d50
feat: update structure/inductive error messages (#9592)
This PR updates the styling and wording of error messages produced in
inductive type declarations and anonymous constructor notation,
including hints for inferable constructor visibility updates.
2025-07-29 21:27:30 +00:00

31 lines
856 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"