[229] Erroneous "Cannot access non-static method 'ToString' in static context" message.

The following code provides the subject message, applying it to
".ToString()":

public class SomeClass
{
public static Int32 Int32 { get { return 10; } }

public static string Some()
{
return Int32.ToString();
}
}

In general this error is applyed to any static property that has the same
name as some class, when we use its non-static member. Compilation
succeeds without any notifications and works properly.

2 comments
Comment actions Permalink

Serge Populov wrote:

In general this error is applyed to any static property that has the
same name as some class, when we use its non-static member.
Compilation succeeds without any notifications and works properly.


I have posted a bug report about this problem for build 227 (Tracker
Request # 21132). The bug tracker still shows it as not fixed, but the
bug seems to have disappeared in build 231. At least I cannot reproduce
it anymore since 231.

Max

0
Comment actions Permalink

"Markus Stoeger" <spamhole@gmx.at> wrote in message
news:e0o3s0$ip3$1@is.intellij.net...

Serge Populov wrote:

In general this error is applyed to any static property that has the
same name as some class, when we use its non-static member.
Compilation succeeds without any notifications and works properly.

>

I have posted a bug report about this problem for build 227 (Tracker
Request # 21132). The bug tracker still shows it as not fixed, but the
bug seems to have disappeared in build 231. At least I cannot reproduce
it anymore since 231.


It sounds like it might be related to
http://www.intellij.net/tracker/resharper/viewSCR?publicId=19694 which was
fixed in 230.


Regards,

Lionel


0

Please sign in to leave a comment.