From 32c98435486cff69f7ecbcfb2be3c8f1739fe177 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 12 May 2020 16:22:53 -0600 Subject: Fix undefined identifiers resulting in incorrect types --- tests/include/tast2.h | 15 +++++++++++++++ tests/tast2.nim | 3 +++ 2 files changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/include/tast2.h b/tests/include/tast2.h index bbb3315..f28c003 100644 --- a/tests/include/tast2.h +++ b/tests/include/tast2.h @@ -49,6 +49,21 @@ extern "C" { #define ALLSHL (SHL1 | SHL2 | SHL3) +// const not supported yet +const int SOME_CONST = 8; + +struct some_struct_s +{ + int x; +}; + +struct parent_struct_s +{ + struct some_struct_s s[SOME_CONST]; +}; + +typedef struct some_struct_s SOME_ARRAY[SOME_CONST]; + struct A0; struct A1 {}; typedef struct A2; diff --git a/tests/tast2.nim b/tests/tast2.nim index 4fd16cc..058ad0b 100644 --- a/tests/tast2.nim +++ b/tests/tast2.nim @@ -155,6 +155,9 @@ assert typeof(POINTERPOINTERPOINTEREXPR) is (ptr ptr ptr cint) assert ALLSHL == (SHL1 or SHL2 or SHL3) +assert not compiles(parent_struct_s().s) +assert not defined(SOME_ARRAY) + assert A0 is object testFields(A0, "f1!cint") checkPragmas(A0, pHeaderBy, istype = false) -- cgit v1.2.3