Generics are not being parsed correctly during code analysis

I have two separate examples of time that code analysis has underlined legal
C# syntax, but the C# compiler has allowed the code:

Dictionary> instrumentationEvents = GetAttributedMembers(eventSource); The parser reports "Cannot convert source type 'System.Collections.Generic.Dictionary>' to target type 'System.Collections.Generic.Dictionary>' " And it also flags this code: private class SingleSubjectSource { [InstrumentationProvider("foo")] public event EventHandler]]> Foo;
}

"Delegate 'void EventHandler(object, EventArgs)' does not have type parameters"

Both of these are valid generic statements and should not be flagged by code
analysis.

bab


1 comment
Comment actions Permalink

Please, could you post futher such bugs into our tracker?
This one I'll duplicate into tracker.

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Brian Button" <bbutton@agilestl.com> wrote in message
news:b9a1d86b6f17b8c77ddb01705394@news.jetbrains.com...
>I have two separate examples of time that code analysis has underlined
>legal C# syntax, but the C# compiler has allowed the code:
>

Dictionary<string, List<EventInfo>> instrumentationEvents =
GetAttributedMembers<EventInfo,
InstrumentationProviderAttribute>(eventSource);

>

The parser reports "Cannot convert source type
'System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<System.Reflection.EventInfo>>'
to target type
'System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<EventInfo>>'
"

>

And it also flags this code:

>

private class SingleSubjectSource
{
[InstrumentationProvider("foo")]
public event EventHandler<EventArgs> Foo;
}

>

"Delegate 'void EventHandler(object, EventArgs)' does not have type
parameters"

>

Both of these are valid generic statements and should not be flagged by
code analysis.

>

bab

>



0

Please sign in to leave a comment.