Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1522: Refactor "Encapsulate Field"

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
bugfix Posted - Jun 14 2006 : 01:28:48 AM
This happend after x->Encapsulate Field



-bugfix

sorry for all those bugreports:)
11   L A T E S T    R E P L I E S    (Newest First)
support Posted - Aug 08 2006 : 01:16:18 AM
Case 1361 is fixed in build 1531.
support Posted - Jun 18 2006 : 1:05:31 PM
Both original problems in this topic are fixed in 1524.
feline Posted - Jun 18 2006 : 09:18:43 AM
surely you should just accept that our software is perfect, and has no bugs, as a matter of faith?
bugfix Posted - Jun 18 2006 : 09:07:57 AM
Yups, I know that's just a autotext template, just wanted to point it out.
Nope, I don't have that problem often if at all, I was just searching for bugs:)
feline Posted - Jun 18 2006 : 08:54:46 AM
now i see. what has happened is that there is only one autotext rule for Encapsulate Field. if you look for the autotext entry "Refactor Encapsulate Field" you will see that the accessor function is const. simply remove this const from the autotext rule and it will fix this.

unfortunately this is a special case where the normal autotext rule may not apply. the problem here is that the autotext rule is user editable.

do you often have member variables in a namespace? i tend not to use namespaces, so to me this seems like a strange idea, they look horribly close to global variables, which i have a slight objection to
bugfix Posted - Jun 18 2006 : 08:42:56 AM

namespace bla
{ 
    int x|; 
    // after encapsulate
    int X() const { return x; } // const modifier not allowed
    void X(int val) { x = val; }
};
feline Posted - Jun 18 2006 : 08:37:14 AM
i am seeing the same thing with the template class

case=1361

i have just tried Encapsulate Field on several different member variables inside a class inside a namespace, using VS2003, VA 1524 and C++, and i am not getting any problems.

true i am getting both accessor functions for a const member function, but that is what i asked for. in this case i would say VA is following my instructions, leaving me to sort out what i want later on. i am assuming you are seeing something else, but what. can you post a code sample to explain what is happening?
bugfix Posted - Jun 18 2006 : 02:12:13 AM

template<typename T>
class VaxTempl 
{  T* m|; };

class Blub;
typedef VaxTempl<const Blub> VaxTemplBlub;

Results in:

typedef VaxTempl<const Blub	T* M() const { return m; }
void M(T* val) { m = val; }

Seems like "const" in the typedef triggers some misbehavior in VAX.

Another thing i've noticed is that the autotext template for "Encapsulate Field" produces wrong code for variables declared in a namespace. Modifiers like "const" are not allowed.

-bugfix

VAX 1524
support Posted - Jun 14 2006 : 9:46:54 PM
case=1321
support Posted - Jun 14 2006 : 12:22:56 PM
Both problems will be fixed in 1523.
bugfix Posted - Jun 14 2006 : 06:44:10 AM
one more:)

namespace bla
{ class VaxTempl{}; };

bla::VaxTempl x|;

x->Encapsulate Field results in

bla.VaxTempl X() const { return x; }
void X(bla.VaxTempl val) { x = val; }

bla.VaxTempl is obviously wrong.

-bugfix

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