lean4-htt/tests/lean/run/structInst4.lean
Leonardo de Moura a01552d361 chore: fix some tests
Two of them are still broken due to a bug in the new elaborator.
2020-05-21 09:50:20 -07:00

27 lines
499 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.

universes u
def a : Array ((Nat × Nat) × Bool) := #[]
def b : Array Nat := #[]
structure Foo :=
(x : Array ((Nat × Nat) × Bool) := #[])
(y : Nat := 0)
new_frontend
#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 }