This PR adds two validation checks to `addInstance` that provide early feedback for common mistakes in instance declarations: 1. **Non-class instance check**: errors when an instance target type is not a type class. This catches the common mistake of writing `instance` for a plain structure. Previously handled by the `nonClassInstance` linter in Batteries (`Batteries.Tactic.Lint.TypeClass`), this is now checked directly at declaration time. 2. **Impossible argument check**: errors when an instance has arguments that cannot be inferred by instance synthesis. Specifically, it flags arguments that are not instance-implicit and do not appear in any subsequent instance-implicit argument or in the return type. Previously such instances would be silently accepted but could never be synthesised. Supersedes #13237 and #13333.
98 lines
4.7 KiB
Text
98 lines
4.7 KiB
Text
linterUnusedVariables.lean:18:21-18:22: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:19:6-19:7: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:24:8-24:9: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:40:5-40:6: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:45:5-45:6: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:48:7-48:8: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:51:8-51:9: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:55:9-55:10: warning: unused variable `z`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:57:11-57:12: warning: unused variable `z`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:62:14-62:15: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:68:20-68:21: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:73:34-73:38: warning: unused variable `inst`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:114:25-114:26: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:115:6-115:7: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:121:6-121:7: warning: unused variable `a`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:131:26-131:27: warning: unused variable `z`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:140:9-140:10: warning: unused variable `h`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:154:8-154:9: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:157:28-157:29: warning: unused variable `β`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:158:7-158:8: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:168:6-168:7: warning: unused variable `s`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:192:6-192:7: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:202:19-202:20: warning: unused variable `x`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:206:6-206:7: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:211:6-211:7: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:216:6-216:7: warning: unused variable `y`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:227:32-227:33: warning: unused variable `b`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|
|
linterUnusedVariables.lean:245:27-245:28: error: don't know how to synthesize placeholder
|
|
context:
|
|
a : Nat
|
|
⊢ Nat
|
|
linterUnusedVariables.lean:246:0-246:7: warning: declaration uses `sorry`
|
|
linterUnusedVariables.lean:247:0-247:7: warning: declaration uses `sorry`
|
|
linterUnusedVariables.lean:248:27-248:29: error: unsolved goals
|
|
a : Nat
|
|
⊢ Nat
|
|
linterUnusedVariables.lean:249:33-249:40: error: unsolved goals
|
|
a : Nat
|
|
⊢ Nat
|
|
linterUnusedVariables.lean:249:0-249:40: error: type of theorem `async` is not a proposition
|
|
Nat → Nat
|
|
linterUnusedVariables.lean:284:41-284:43: warning: unused variable `ha`
|
|
|
|
Note: This linter can be disabled with `set_option linter.unusedVariables false`
|