This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 164559 [details] Screenshot When declaring multiple structures in the same macro, the code completion incorrectly types all structures as the last used type. Example below. All of the following have the type MsgC, when they should be MsgA/MsgB/MsgC. list2_.aaa.msg.a list2_.bbb.msg.b list2_.ccc.msg.c /******************************************************************************/ // Simple message structures typedef struct { int a; } MsgA; typedef struct { int b; } MsgB; typedef struct { int c; } MsgC; typedef struct { int d; } MsgD; typedef struct { int e; } MsgE; typedef struct { int f; } MsgF; // X-Macro for list elements: X(name,MsgName) #define MY_LIST1 \ X(aaa, MsgA)\ X(bbb, MsgB)\ X(ccc, MsgC)\ // X-Macro for list elements: X(name,MsgName) #define MY_LIST2 \ X(ddd, MsgD)\ X(eee, MsgE)\ X(fff, MsgF)\ // Generate structure of all messages #define X(name,MsgName) MsgName name; static struct { MY_LIST1 MY_LIST2 } list1_ = {0}; #undef X // Generate structure of all messages #define X(name,MsgName) struct { MsgName msg; } name; static struct { MY_LIST1 MY_LIST2 } list2_ = {0}; #undef X // Generate structure of all messages #define X(name,MsgName) struct { MsgName msg; } list3_##name; MY_LIST1 MY_LIST2 #undef X static void test() { list1_.aaa.a; list1_.ddd.d; list1_.bbb.b; list1_.eee.e; list1_.ccc.c; list1_.fff.f; list2_.aaa.msg.a; list2_.ddd.msg.d; list2_.bbb.msg.b; list2_.eee.msg.e; list2_.ccc.msg.c; list2_.fff.msg.f; list3_aaa.msg.a; list3_ddd.msg.d; list3_bbb.msg.b; list3_eee.msg.e; list3_ccc.msg.c; list3_fff.msg.f; }
Created attachment 164560 [details] test case
New issue: https://issues.apache.org/jira/browse/NETBEANS-1413