blob: 6be1eef00205c50aa8ef90656c89e1d6c8f5ae80 [file] [edit]
/-!
# Testing "go to definition" for `structure` fields
-/
--^ collectDiagnostics
structure S where
a : Nat
/- Dependence in type -/
b : Fin a
--^ textDocument/definition
/- Dependence in default value. -/
c : Nat := a + b
--^ textDocument/definition
--^ textDocument/definition
/-!
"Go to definition" for a field
-/
example (s : S) := s.b
--^ textDocument/definition
/-!
The field terminfo is still available even if there is an exception during elaboration.
Field redeclaration currently throws an exception, preventing the step where the projection
terminfos are added (and preventing adding the structure to the environment).
-/
structure SInvalid where
a : Nat
--^ textDocument/hover
a : Nat
-- Check that the structure is never added to the environment:
#check SInvalid