lean4-htt/tests/lean/run/structInst4.lean
Leonardo de Moura 4568fe755c chore: fix tests
2022-07-02 15:25:06 -07:00

25 lines
485 B
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.

universe u
def a : Array ((Nat × Nat) × Bool) := #[]
def b : Array Nat := #[]
structure Foo :=
(x : Array ((Nat × Nat) × Bool) := #[])
(y : Nat := 0)
#check (b).modifyOp (idx := 1) (fun s => 2)
#check { b with [1] := 2 }
#check { a with [1].fst.2 := 1 }
def foo : Foo := {}
#check foo.x[1]!.1.2
#check { foo with x[1].2 := true }
#check { foo with x[1].fst.snd := 1 }
#check { foo with x[1].1.fst := 1 }
#check { foo with x[1].1.1 := 5 }
#check { foo with x[1].1.2 := 5 }