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
 1640:using declaration for types inside namespaces
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

.oisyn
Tomato Guru

162 Posts

Posted - Jul 08 2008 :  5:37:28 PM  Show Profile  Reply with Quote
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.

Edited by - .oisyn on Jul 08 2008 5:40:26 PM

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jul 10 2008 :  12:10:39 PM  Show Profile  Reply with Quote
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

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

.oisyn
Tomato Guru

162 Posts

Posted - Jul 14 2008 :  6:05:39 PM  Show Profile  Reply with Quote
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)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Jul 15 2008 :  09:34:26 AM  Show Profile  Reply with Quote
True, its not a very elegant work around, but it might help a bit

zen is the art of being at one with the two'ness
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