When `pp.safe_shadowing` is set to true, we still use the
suggested name if the "body" does not contain a free variable with the
suggested name. This is the approach used in Lean 3, and I think it
improved the result in all affected tests.
The implementation was simple. The only nasty case was `delabAppMatch`.
The main motivation for this feature was hovering information such as
```lean
f : {α_1 : Type} → α_1 → α_1
```
when hovering over the `f` at
```lean
def g (α : Type) (a : α) :=
f a
```
With `safe_shadowing`, we get the nicer
```lean
f : {α : Type} → α → α
```
cc @Kha
15 lines
825 B
Text
15 lines
825 B
Text
myid 10 : Nat
|
||
myid true : Bool
|
||
autoBoundImplicits1.lean:17:18-17:23: warning: declaration uses 'sorry'
|
||
autoBoundImplicits1.lean:20:25-20:29: error: unknown identifier 'size'
|
||
autoBoundImplicits1.lean:21:18-21:23: warning: declaration uses 'sorry'
|
||
autoBoundImplicits1.lean:24:23-24:24: error: unknown identifier 'α'
|
||
autoBoundImplicits1.lean:24:25-24:26: error: unknown identifier 'n'
|
||
autoBoundImplicits1.lean:24:33-24:34: error: unknown identifier 'α'
|
||
autoBoundImplicits1.lean:24:37-24:38: error: unknown identifier 'β'
|
||
autoBoundImplicits1.lean:24:46-24:47: error: unknown identifier 'β'
|
||
autoBoundImplicits1.lean:24:48-24:49: error: unknown identifier 'n'
|
||
autoBoundImplicits1.lean:25:18-25:23: warning: declaration uses 'sorry'
|
||
f : {α : Type} → {n : Nat} → Vec α n → Vec α n
|
||
f mkVec : Vec ?m 0
|
||
f mkVec : Vec Nat 0
|