Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1522: Refactor "Encapsulate Field"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 14 2006 :  01:28:48 AM  Show Profile  Reply with Quote
This happend after x->Encapsulate Field



-bugfix

sorry for all those bugreports:)

http://www.mf-sd.de

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 14 2006 :  06:44:10 AM  Show Profile  Reply with Quote
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

http://www.mf-sd.de
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 14 2006 :  12:22:56 PM  Show Profile  Reply with Quote
Both problems will be fixed in 1523.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 14 2006 :  9:46:54 PM  Show Profile  Reply with Quote
case=1321
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 18 2006 :  02:12:13 AM  Show Profile  Reply with Quote

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

http://www.mf-sd.de

Edited by - bugfix on Jun 18 2006 02:13:20 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jun 18 2006 :  08:37:14 AM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 18 2006 :  08:42:56 AM  Show Profile  Reply with Quote

namespace bla
{ 
    int x|; 
    // after encapsulate
    int X() const { return x; } // const modifier not allowed
    void X(int val) { x = val; }
};

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jun 18 2006 :  08:54:46 AM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 18 2006 :  09:07:57 AM  Show Profile  Reply with Quote
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:)

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jun 18 2006 :  09:18:43 AM  Show Profile  Reply with Quote
surely you should just accept that our software is perfect, and has no bugs, as a matter of faith?

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 18 2006 :  1:05:31 PM  Show Profile  Reply with Quote
Both original problems in this topic are fixed in 1524.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 08 2006 :  01:16:18 AM  Show Profile  Reply with Quote
Case 1361 is fixed in build 1531.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000