lean4-htt/tests/lean/match1.lean.expected.out
Joachim Breitner 8431088c93
fix: preserve error locations when expanding match arms (#10783)
This PR ensures that error messages such as “redundant alternative” have
the right error location even if the arms share their RHS. Fixes #10781.
2025-10-15 13:31:42 +00:00

50 lines
1.3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---- h1
10
---- h2
3
10
0
---- h3
10
30
4
---- inv
10
match1.lean:82:2-82:60: error: Dependent elimination failed: Type mismatch when solving this alternative: it has type
motive 0 (Vec.cons head✝ Vec.nil) ⋯
but is expected to have type
motive x✝ (Vec.cons head✝ tail✝) ⋯
[false, true, true]
match1.lean:119:2-119:18: error: Dependent match elimination failed: Expected a constructor, but found the inaccessible pattern
.(j + j)
[false, true, true]
match1.lean:136:7-136:22: error: Invalid match expression: The type of pattern variable 'a' contains metavariables:
?m
fun x => ?m : ?m × ?m → ?m
fun x =>
match x with
| (a, b) => a + b : Nat × Nat → Nat
fun x =>
match x with
| (a, b) => a && b : Bool × Bool → Bool
fun x =>
match x with
| (a, b) => a + b : Nat × Nat → Nat
fun x x_1 =>
match x, x_1 with
| some a, some b => some (a + b)
| x, x_2 => none : Option Nat → Option Nat → Option Nat
fun x =>
(match (motive := Nat → Nat → Nat) x with
| 0 => id
| x.succ => id)
x : Nat → Nat
fun x =>
match x with
| #[1, 2] => 2
| #[] => 0
| #[3, 4, 5] => 3
| x => 4 : Array Nat → Nat
g.match_1.{u_1, u_2} {α : Type u_1} (motive : List α → Sort u_2) (x✝ : List α) (h_1 : (a : α) → motive [a])
(h_2 : (x : List α) → motive x) : motive x✝
fun e => nomatch e : ∀ (e : Empty), False