From bc55a2c25d0f2f630acf457420d5b868d2855ebc Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 16 Jan 2020 18:36:35 +0000 Subject: Cleanup type-checking rule for LEXP_field Was being overly conservative with nested structs and used an incorrect location for the error message --- test/c/nested_fields.expect | 1 + test/c/nested_fields.sail | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/c/nested_fields.expect create mode 100644 test/c/nested_fields.sail (limited to 'test') diff --git a/test/c/nested_fields.expect b/test/c/nested_fields.expect new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/test/c/nested_fields.expect @@ -0,0 +1 @@ +2 diff --git a/test/c/nested_fields.sail b/test/c/nested_fields.sail new file mode 100644 index 00000000..1e26dac9 --- /dev/null +++ b/test/c/nested_fields.sail @@ -0,0 +1,20 @@ +default Order dec + +$include + +struct B = { + f3: int, + f4: int, +} + +struct A = { + f1: B, + f2: int, +} + +register R : A + +function main() -> unit = { + R.f1.f3 = 2; + print_int("", R.f1.f3) +} \ No newline at end of file -- cgit v1.2.3