lean4-htt/tests/lean/run/3996.lean
Leonardo de Moura de5e039c83
fix: type class issues with maxSynthPendingDepth := 1 (#4119)
Summary:

- Take `synthPendingDepth` into account when caching TC results
- Add `maxSynthPendingDepth` option with default := 2.
- Add support for tracking `synthPending` failures when using
`set_option diagnostics true`

closes #2522
closes #3313
closes #3927

Identical to #4114  but with `maxSynthPendingDepth := 1`

closes #4114 

cc @semorrison
2024-05-14 03:03:32 +00:00

44 lines
654 B
Text

namespace Ex1
class A where
class B (n : Nat) where
class C where
instance test [B 10000] [C] : A where
instance Bsucc {n : Nat} [B n] : B n.succ where
instance instB0 : B 0 where
instance instB10000 : B 10000 where
/--
error: failed to synthesize
A
use `set_option diagnostics true` to get diagnostic information
-/
#guard_msgs in
#synth A -- should fail quickly
end Ex1
namespace Ex2
class A where
class B (n : Nat) where
class C where
instance test' [B 10] : A where
instance test [B 0] [C] : A where
instance foo {n : Nat} [B n.succ] : B n where
instance instB (n : Nat) : B n where
/--
info: test'
-/
#guard_msgs in
#synth A
end Ex2