GetType Method Call on a Generic Type

Hi,

I haven't read all the previous posts to see if this has been reported yet,
so if it has I'm sorry to be redundant.

My scenario is relatively simple: I have a generic method that accepts a
generic type as a parameter. When I call "GetType( )" on that parameter,
Resharper tracks it as a syntax error. Everything compiles fine, but the
Resharper syntax error warning (a highlight in red) remains.

Here is the method signature:

public void Save]]>(T obj);

And here is the call inside of this method:

obj.GetType( );

I do not constrain this parameter, nor should I need to because GetType is
found in the "object" class.

~Steve


1 comment
Comment actions Permalink

Stephen,

This is a subject of http://www.jetbrains.net/jira/browse/RSRP-26961
Will be fixed shortly.

Friendly,
Dmitry

Hi,

I haven't read all the previous posts to see if this has been reported
yet, so if it has I'm sorry to be redundant.

My scenario is relatively simple: I have a generic method that accepts
a generic type as a parameter. When I call "GetType( )" on that
parameter, Resharper tracks it as a syntax error. Everything compiles
fine, but the Resharper syntax error warning (a highlight in red)
remains.

Here is the method signature:

public void Save<T>(T obj);

And here is the call inside of this method:

obj.GetType( );

I do not constrain this parameter, nor should I need to because
GetType is found in the "object" class.

~Steve

--
Dmitry Lomov
Senior Software Developer
JetBrains, Inc.
"Develop With Pleasure!"


0

Please sign in to leave a comment.