[250] Incorrect error highlighting?

Hello,

R# 250 indicates the following code as error, while the Microsoft
compiler compiles it without any problem. Who is wrong (according to the
specs ;))?


using System.Collections.Generic;

namespace MyNameSpace.List {

public class TheList {
}

}

namespace MyNameSpace {

public class MyTestClass {

List test; } } The error is indicated at the Line "List]]> test;". The indicated
error is "Type name expected, but namespace found".

Best regards,
Martin

2 comments
Comment actions Permalink

Looks like this is ReSharper's problem.
I've created tracker record, you could track when this will be fixed

http://www.intellij.net/tracker/resharper/viewSCR?publicId=26143

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Martin Carpella" <martin.carpella@gmx.net> wrote in message
news:874pyyqy06.fsf@msgid.carpella.net...

Hello,

>

R

  1. 250 indicates the following code as error, while the Microsoft

compiler compiles it without any problem. Who is wrong (according to the
specs ;))?

>
>

using System.Collections.Generic;

>

namespace MyNameSpace.List {

>

public class TheList {
}

>

}

>

namespace MyNameSpace {

>

public class MyTestClass {

>

List<string> test;

>

}

>

}

>

The error is indicated at the Line "List<string> test;". The indicated
error is "Type name expected, but namespace found".

>

Best regards,
Martin



0
Comment actions Permalink

This post is not directly connected to the problem but I just want to spil
out that a recommended practice is to use the generic CLR type name instead
of the language-specific names, the so-called aliases to ensure that you
take the full advantage of the cross-language interoperation. (Cfr
"Framework Design Guidelines" p. 44-45) I have even heard from reading it
here and there that aliases might even be dropped in future versions of C#.

Eg:

Instead of using the alias string consider using System.String, instead of
int use System.Int32 ...

Gabriel Lozano-Morán
The .NET Aficionado
http://www.pointerx.net


"Martin Carpella" <martin.carpella@gmx.net> wrote in message
news:874pyyqy06.fsf@msgid.carpella.net...

Hello,

>

R

  1. 250 indicates the following code as error, while the Microsoft

compiler compiles it without any problem. Who is wrong (according to the
specs ;))?

>
>

using System.Collections.Generic;

>

namespace MyNameSpace.List {

>

public class TheList {
}

>

}

>

namespace MyNameSpace {

>

public class MyTestClass {

>

List<string> test;

>

}

>

}

>

The error is indicated at the Line "List<string> test;". The indicated
error is "Type name expected, but namespace found".

>

Best regards,
Martin



0

Please sign in to leave a comment.