This PR gives suggestions based on the currently-available constants when projecting from an unknown type. ## Example: single suggestion in namespace This was the originally motivating example, as the string refactor led to a number of anonymous-lambda-expressions with `Char` functions that were no longer recognized as such. ```lean4 example := (·.isWhitespace) ``` Before: ``` Invalid field notation: Type of x✝ is not known; cannot resolve field `isWhitespace` ``` The message is unchanged, but this PR adds a hint: ``` Hint: Consider replacing the field projection `.isWhitespace` with a call to the function `Char.isWhitespace`. ``` ## Example: single suggestion in namespace ```lean4 example := fun n => n.succ ``` Before: ``` Invalid field notation: Type of n is not known; cannot resolve field `succ` ``` The message is unchanged, but this PR adds a hint: ``` Hint: Consider replacing the field projection with a call to one of the following: • `Fin.succ` • `Nat.succ` • `Std.PRange.succ` ``` |
||
|---|---|---|
| .. | ||
| bench | ||
| bench-radar | ||
| compiler | ||
| elabissues | ||
| ir | ||
| lake | ||
| lean | ||
| pkg | ||
| playground | ||
| plugin | ||
| simpperf | ||
| .gitignore | ||
| common.sh | ||
| lakefile.toml | ||
| lean-toolchain | ||