This PR updates the formatting of, and adds explanations for, "unknown identifier" errors as well as "failed to infer type" errors for binders and definitions. It attempts to ameliorate some of the confusion encountered in #1592 by modifying the wording of the "header is elaborated before body is processed" note and adding further discussion and examples of this behavior in the corresponding error explanation.
31 lines
854 B
Text
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"
|