This PR improves the error messages produced by invalid projections and field notation. It also adds a hint to the "function expected" error message noting the argument to which the term is being applied, which can be helpful for debugging spurious "function expected" messages actually caused by syntax errors. --------- Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
31 lines
848 B
Text
31 lines
848 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")
|
|
⏎
|
|
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"
|