From 8324ea546ddeec818970e25dfe2cf145995a3eb4 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 31 Oct 2024 11:07:35 +0100 Subject: [PATCH] additional nested datatype test --- source/air/src/tests.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/air/src/tests.rs b/source/air/src/tests.rs index 2b8cd54ca..aa4913ee7 100644 --- a/source/air/src/tests.rs +++ b/source/air/src/tests.rs @@ -2190,6 +2190,21 @@ fn nested_datatype_field_update_pass() { ) } +#[test] +fn nested_datatype_field_update_pass2() { + yes!( + (declare-datatypes ((A 0)) (((A_A (A_A_u Int) (A_A_v Int))))) + (declare-datatypes ((B 0)) (((B_B (B_B_a1 A) (B_B_a2 A))))) + (check-valid + (declare-var b B) + (block + (assign b ((_ update-field B_B_a1) b ((_ update-field A_A_u) (B_B_a1 b) 3))) + (assert (= (A_A_u (B_B_a1 b)) 3)) + ) + ) + ) +} + #[test] fn nested_datatype_field_update_fail() { no!(