lean4-htt/tests/lean/match1.lean.expected.out
Kyle Miller d39b0415f0
feat: enable pp.fieldNotation.generalized globally (#3744)
Sets the default value to `pp.fieldNotation.generalized` to `true`.
Updates tests, and fixes some minor flaws in the implementation of the
generalized field notation pretty printer.

Now generalized field notation won't be used for any function that has a
`motive` argument. This is intended to prevent recursors from pretty
printing using it as (1) recursors are more like control flow structures
than actual functions and (2) generalized field notation tends to cause
elaboration problems for recursors.

Note: be sure functions that have an `@[app_unexpander]` use
`@[pp_nodot]` if applicable. For example, `List.toArray` needs
`@[pp_nodot]` to ensure the unexpander prints it using `#[...]`
notation.
2024-03-23 02:38:09 +00:00

51 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:0-82:73: error: dependent elimination failed, type mismatch when solving alternative with type
motive 0 (Vec.cons head✝ Vec.nil) ⋯
but expected
motive x✝ (Vec.cons head✝ tail✝) ⋯
[false, true, true]
match1.lean:119:0-119:41: error: dependent match elimination failed, inaccessible pattern found
.(j + j)
constructor expected
[false, true, true]
match1.lean:136:7-136:22: error: invalid match-expression, type of pattern variable 'a' contains metavariables
?m
fun x => ?m x : ?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 α) → ((a : α) → motive [a]) → ((x : List α) → motive x) → motive x
fun e => nomatch e : Empty → False