Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1640:using declaration for types inside namespaces

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
.oisyn Posted - Jul 08 2008 : 5:37:28 PM
I'm experiencing a case of bad coloring when using a 'using declaration' inside a namespace to introduce a type from another namespace, but only if that other namespace was included from a header.

// test.h
namespace Foo
{
    typedef int mytype;
};

// test.cpp
#include "test.h"

namespace Bar
{
    using Foo::mytype;  // #1
    mytype func();      // #2
}


At #2, 'mytype' is shown in darkblue coloring on my machine, which is the same color as for functions. For #1, the coloring differs. In the small testcase above 'mytype' here appears in normal type coloring, but in the actual project where I encountered the bug it colors as a method as well.

The funny thing is, if I move the using declaration (at #1) to global namespace scope, coloring is correct. Also, when defining the namespace Foo in the same file (but keeping the using declaration in the Bar namespace), coloring is correct as well.

Also, this only applies to types. When using a using declaration for variables, coloring is correct as well.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 15 2008 : 09:34:26 AM
True, its not a very elegant work around, but it might help a bit
.oisyn Posted - Jul 14 2008 : 6:05:39 PM
But then it's a keyword. I want it to be a type :). And also it will *always* be a keyword, while it actually depends on the context (it could be a function in other contexts)
feline Posted - Jul 10 2008 : 12:10:39 PM
I am seeing the same effect here. Thank you for the clear description.

case=18391

As a temporary work around you may find that telling the IDE that "mytype" is a keyword will help:

http://docs.wholetomato.com?W148

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