Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Rename constructor parameter and class member

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Valiko Posted - Nov 15 2018 : 08:41:02 AM
VAX v.10.9.2291.5.
VS2017 v.15.9.0.
Project configuration: Release x64 console app.

ORIGINAL CODE:

struct Node
{
    Node(uint64_t key)
    : key(key)
    {
    }

    uint64_t key;
};

CASE1: I select "key" in constructor parameter list and Rename it to "state". I expect to get the following code:

struct Node
{
    Node(uint64_t state)
    : key(state)
    {
    }

    uint64_t key;
};

but get the following (which is obviously not compiled):

struct Node
{
    Node(uint64_t state)
    : state(state)
    {
    }

    uint64_t key;
};

CASE2: When I select "key" member and Rename it to "state" (in the same original code). I expect to get:

struct Node
{
    Node(uint64_t key)
    : state(key)
    {
    }

    uint64_t state;
};

but get the following (which is obviously not compiled):

struct Node
{
    Node(uint64_t key)
    : key(key)
    {
    }

    uint64_t state;
};


In both cases other entity could be shown in candidates list but left unchecked so that user could select it if they want.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 16 2018 : 11:18:45 AM
I am seeing the same problem here, thank you for the clear example:

case=41620

this is a situation where it is legal to use the same symbol name for both the parameter and the class member variable. Unfortunately this confuses our parser, so we are not limiting the scope correctly here, hence the bug.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000