Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Bug: "Implement Method" and return types

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
MrDoomMaster Posted - Jan 05 2018 : 1:52:26 PM
When I have a member function declaration that has a return type of a class that is within the namespace of the owning class, that return type is always fully qualified when using "Implement Method", even though it's unnecessary and the declaration did not fully qualify the type. I'll give you a reproducible example.

Start out with the following files in Visual Studio 2017.

Header File (Test.hpp):


namespace Test
{
   class FirstClass
   {
   };

   class SecondClass
   {
   public:

      FirstClass DoAThing();
   };
}


Source File (Test.cpp):


#include "Test.hpp"

namespace Test
{

}


Now right-click "DoAThing()" in the header and click "Create Implementation". You get the following in the source file:


#include "Menu.hpp"

namespace Test
{

   ///////////////////////////////////////////////////////////////////////////////
   ///
   ///////////////////////////////////////////////////////////////////////////////
   Test::FirstClass SecondClass::DoAThing()
   {

   }

}


By the way, here is my customized "Create Implementation" template which I altered slightly from the VAX default:



///////////////////////////////////////////////////////////////////////////////
///
///////////////////////////////////////////////////////////////////////////////
$SymbolType$ $SymbolContext$($ParameterList$) $MethodQualifier$
{
	$end$$MethodBody$
}




Notice that in the generated implementation in the source file, the return type appears as Test::FirstClass. I want this return type to be FirstClass instead (minus the "Test::"). This is not necessary since the definition of the function is placed inside the "Test" namespace.

I expect that Visual Assist should make it a priority to keep return types identical to how they appear in the declaration. And only if it determines keeping it that way may result in a compiler error (assuming it does this type of introspection), it should try to correct it by qualifying it only as necessary. It especially needs to be smart enough about nested namespaces and only go up as far as needed to resolve the type.
2   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jan 06 2018 : 06:02:18 AM
I am seeing the same effect here. Thank you for the clear description.

case=6130
MrDoomMaster Posted - Jan 05 2018 : 1:54:25 PM
Forgot to provide system info. Please see below.


License: [email protected] (2-user license) Support ends 2018.08.11
VA_X.dll file version 10.9.2238.2  built 2017.11.10
DevEnv.exe version 15.0.27130.2010 Professional
msenv.dll version 15.0.27130.2010
Comctl32.dll version 6.10.14393.447
Windows 10 10.0 Build 14393 
8 processors (x86-64, WOW64)
Language info: 1252, 0x409

Platform: Project defined
Stable Includes:
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.2\Include\um;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\winrt;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\VS\UnitTest\include;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\VS\include;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\atlmfc\include;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include;

Other Includes:

Stable Source Directories:
C:\Program Files (x86)\Windows Kits\10\Source\10.0.14393.0\ucrt;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\VS\src;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\crt\src;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\atlmfc\src\atl;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\atlmfc\src\mfcm;
E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\atlmfc\src\mfc;


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