Author |
Topic |
|
bugfix
Tomato Guru
Germany
324 Posts |
Posted - Jun 14 2006 : 01:28:48 AM
|
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
|
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 |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jun 14 2006 : 12:22:56 PM
|
Both problems will be fixed in 1523. |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jun 14 2006 : 9:46:54 PM
|
case=1321 |
|
|
bugfix
Tomato Guru
Germany
324 Posts |
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 |
http://www.mf-sd.de |
Edited by - bugfix on Jun 18 2006 02:13:20 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
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? |
zen is the art of being at one with the two'ness |
|
|
bugfix
Tomato Guru
Germany
324 Posts |
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; }
};
|
http://www.mf-sd.de |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
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 |
zen is the art of being at one with the two'ness |
|
|
bugfix
Tomato Guru
Germany
324 Posts |
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:)
|
http://www.mf-sd.de |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
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? |
zen is the art of being at one with the two'ness |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jun 18 2006 : 1:05:31 PM
|
Both original problems in this topic are fixed in 1524. |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Aug 08 2006 : 01:16:18 AM
|
Case 1361 is fixed in build 1531. |
|
|
|
Topic |
|