lean4-htt/tests/lean/run/structInst4.lean
Leonardo de Moura 90a79a0b06 chore: remove command universes
Now, `universe` may declare many universes. The goal is to make it
consistent with the `variable` command
2021-06-29 17:01:07 -07:00

25 lines
484 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 }