lean4-htt/tests/compile
Wojciech Różowski 3fc99eef10
feat: add instance validation checks in addInstance (#13389)
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.
2026-04-16 17:48:16 +00:00
..
534.lean
534.lean.out.expected
append.lean
append.lean.out.expected
arity_bug1.lean
arity_bug1.lean.out.expected
array.lean
array.lean.out.expected
array_test.lean
array_test.lean.out.expected
array_test2.lean
arrayMk.lean
arrayMk.lean.out.expected
bigctor.lean
bigctor.lean.out.expected
bytearray_bug.lean
bytearray_bug.lean.out.expected
closure_bug1.lean
closure_bug1.lean.out.expected
closure_bug2.lean
closure_bug2.lean.out.expected
closure_bug3.lean
closure_bug3.lean.out.expected
closure_bug4.lean
closure_bug4.lean.out.expected
closure_bug5.lean
closure_bug5.lean.out.expected
closure_bug6.lean
closure_bug6.lean.out.expected
closure_bug7.lean
closure_bug7.lean.out.expected
closure_bug8.lean
closure_bug8.lean.out.expected
escape.lean
escape.lean.out.expected
expr.lean
expr.lean.out.expected
extractClosedMutualBlock.lean
extractClosedMutualBlock.lean.out.expected
file_read_overflow.lean fix: file read buffer overflow (#13392) 2026-04-13 17:56:27 +00:00
float.lean
float.lean.out.expected
float_cases_bug.lean
float_cases_bug.lean.out.expected
init.lean
init.lean.no_interpret
init.lean.out.expected
initUnboxed.lean
initUnboxed.lean.no_interpret
initUnboxed.lean.out.expected
large_closure_bug.lean feat: add instance validation checks in addInstance (#13389) 2026-04-16 17:48:16 +00:00
large_closure_bug.lean.out.expected
lazylist.lean
lazylist.lean.no_interpret
lazylist.lean.out.expected
link_lake.lean
map_big.lean
map_big.lean.no_interpret
map_big.lean.out.expected
module.lean
module.lean.out.expected
nat_shiftr.lean
nat_shiftr.lean.out.expected
overflow1.lean
overflow1.lean.out.expected
overflow2.lean
overflow2.lean.out.expected
overflow3.lean
overflow3.lean.out.expected
partial.lean
partial.lean.out.expected
phashmap.lean
phashmap.lean.out.expected
phashmap2.lean
phashmap2.lean.out.expected
phashmap3.lean
phashmap3.lean.out.expected
print_error.lean
print_error.lean.init.sh chore: migrate pkg tests (#12889) 2026-03-11 18:55:46 +00:00
print_error.lean.out.expected
qsortBadLt.lean
qsortBadLt.lean.out.expected
rbmap_library.lean
rbmap_library.lean.out.expected
reduceArity_overapp.lean
reduceArity_overapp.lean.out.expected
reusebug.lean
reusebug.lean.out.expected
run_bench.sh chore: fixes from #13103 "enable separate codegen" (#13241) 2026-04-02 11:13:22 +00:00
run_test.sh chore: fixes from #13103 "enable separate codegen" (#13241) 2026-04-02 11:13:22 +00:00
StackOverflow.lean
StackOverflow.lean.init.sh chore: migrate pkg tests (#12889) 2026-03-11 18:55:46 +00:00
StackOverflow.lean.no_interpret
StackOverflow.lean.out.expected
StackOverflowTask.lean
StackOverflowTask.lean.init.sh chore: migrate pkg tests (#12889) 2026-03-11 18:55:46 +00:00
StackOverflowTask.lean.no_interpret
StackOverflowTask.lean.out.expected
str.lean
str.lean.out.expected
strictAndOr.lean
strictAndOr.lean.out.expected
t1.lean
t1.lean.out.expected
t2.lean
t2.lean.out.expected
t4.lean
t4.lean.out.expected
thunk.lean
thunk.lean.out.expected
trie.lean
trie.lean.out.expected
trigraphs.lean
trigraphs.lean.out.expected
tuple.lean
tuple.lean.out.expected
typeFormerPolymorphism.lean
typeFormerPolymorphism.lean.out.expected
uint_fold.lean
uint_fold.lean.out.expected
unreachable.lean
uset.lean
uset.lean.out.expected
utf8Path.lean
utf8Path.lean.英語
wait_dedicated.lean
wait_dedicated.lean.out.expected