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.

Bug 255876 - Wrong parameters list in compound struct
Summary: Wrong parameters list in compound struct
Status: RESOLVED DUPLICATE of bug 257822
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-12 12:48 UTC by antoniocs
Modified: 2016-08-21 12:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Showing wrong struct completion (4.93 KB, image/png)
2015-10-12 12:48 UTC, antoniocs
Details
Correct code completion (6.11 KB, image/png)
2015-10-12 12:48 UTC, antoniocs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description antoniocs 2015-10-12 12:48:09 UTC
Created attachment 156670 [details]
Showing wrong struct completion

I have an issue with code completion in a compound statement struct being passed to a function that returns another struct
Here is the line of code where I have the problem: 

struct FindResult *res = FindNodeBase(&((struct LLFindNodeBaseParams) {
     .ll = ll, .next = nodeNext
}));

Here is the struct FindResult:

struct FindResult {
    LinkedListNode *prev;
    LinkedListNode *node;
};

Here is the struct LLFindNodeBaseParams:

struct LLFindNodeBaseParams {
    LinkedList *ll;

    void *data;
    LLFindCompareFuncPtr compareFunc;

    LinkedListNode *node;
    LinkedListNode *next;
};

And here is the prototype for FindNodeBase:

static struct FindResult *FindNodeBase(struct LLFindNodeBaseParams *);

As you can see it takes in a struct LLFindNodeBaseParams pointer and returns a pointer to struct FindResult.
So when I start typing (struct LLFindNodeBaseParams) { . inside the parameters list of FindNodeBase I am getting the parameters list from struct FindResult. (I have attached a picture)

If I compile the code everything is fine and if I just create a variable of type struct LLFindNodeBaseParams I get the correct code completion.
Comment 1 antoniocs 2015-10-12 12:48:40 UTC
Created attachment 156671 [details]
Correct code completion
Comment 2 Vladimir Voskresensky 2015-10-12 13:37:18 UTC
Thanks for the report
Comment 3 petrk 2016-08-21 12:53:16 UTC

*** This bug has been marked as a duplicate of bug 257822 ***