lean4-htt/tests/elab/1163.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

39 lines
1.2 KiB
Text

import Lean
open Lean Elab Tactic
macro "obviously1" : tactic => `(tactic| exact sorryAx _ false)
theorem result1 : False := by obviously1
elab "obviously2" : tactic =>
liftMetaTactic1 fun mvarId => mvarId.admit *> pure none
theorem result2 : False := by obviously2
/--
error: failed to synthesize instance of type class
OfNat Bool 0
numerals are polymorphic in Lean, but the numeral `0` cannot be used in a context where the expected type is
Bool
due to the absence of the instance above
Hint: Type class instance resolution failures can be inspected with the `set_option trace.Meta.synthInstance true` command.
-/
#guard_msgs in
def x : Bool := 0
theorem result3 : False := by obviously2
/--
error: failed to synthesize instance of type class
OfNat Bool 0
numerals are polymorphic in Lean, but the numeral `0` cannot be used in a context where the expected type is
Bool
due to the absence of the instance above
Hint: Type class instance resolution failures can be inspected with the `set_option trace.Meta.synthInstance true` command.
-/
#guard_msgs in
theorem result4 : False := by -- Does not generate a `sorry` warning because there is an error
let x : Bool := 0
obviously2