This PR scans the environment for viable replacements for a dotted identifier (like `.zero`) and suggests concrete alternatives as replacements. ## Example ``` #example .zero ``` Error message: ``` Invalid dotted identifier notation: The expected type of `.cons` could not be determined ``` Additional hint added by this PR: ``` Hint: Using one of these would be unambiguous: [apply] `BitVec.cons` [apply] `List.cons` [apply] `List.Lex.cons` [apply] `List.Pairwise.cons` [apply] `List.Perm.cons` [apply] `List.Sublist.cons` [apply] `List.Lex.below.cons` [apply] `List.Pairwise.below.cons` [apply] `List.Perm.below.cons` [apply] `List.Sublist.below.cons` [apply] `Lean.Grind.AC.Seq.cons` ``` ## Additional changes This PR also brings several related error message descriptions and code actions more in line with each other, changing several "Suggested replacement: " code actions to the more common "Change to " wording, and sorts suggestions obtained from searching the context by the default sort for Names (which prefers names with fewer segments).
36 lines
1.4 KiB
Text
36 lines
1.4 KiB
Text
emptyTypeAscription.lean:3:19-3:24: error(lean.invalidDottedIdent): Invalid dotted identifier notation: The expected type of `.zero` could not be determined
|
|
|
|
Hint: Using one of these would be unambiguous:
|
|
[apply] `BitVec.zero`
|
|
[apply] `Dyadic.zero`
|
|
[apply] `Nat.zero`
|
|
[apply] `Vector.zero`
|
|
[apply] `Zero.zero`
|
|
[apply] `System.Uri.UriEscape.zero`
|
|
[apply] `Lean.Grind.IntModule.OfNatModule.zero`
|
|
[apply] `Lean.Grind.Linarith.Expr.zero`
|
|
emptyTypeAscription.lean:4:29-4:34: error(lean.invalidDottedIdent): Invalid dotted identifier notation: The expected type of `.zero` could not be determined
|
|
|
|
Hint: Using one of these would be unambiguous:
|
|
[apply] `BitVec.zero`
|
|
[apply] `Dyadic.zero`
|
|
[apply] `Nat.zero`
|
|
[apply] `Vector.zero`
|
|
[apply] `Zero.zero`
|
|
[apply] `System.Uri.UriEscape.zero`
|
|
[apply] `Lean.Grind.IntModule.OfNatModule.zero`
|
|
[apply] `Lean.Grind.Linarith.Expr.zero`
|
|
emptyTypeAscription.lean:9:63-9:70: error: invalid `▸` notation, expected result type of cast is
|
|
w = add x y
|
|
however, the equality
|
|
h₁
|
|
of type
|
|
z = x + y
|
|
does not contain the expected result type on either the left or the right hand side
|
|
emptyTypeAscription.lean:10:55-10:62: error: invalid `▸` notation, expected result type of cast is
|
|
w = add x y
|
|
however, the equality
|
|
h₁
|
|
of type
|
|
z = x + y
|
|
does not contain the expected result type on either the left or the right hand side
|