bkoelman / ResharperCodeContractNullability

Reports diagnostics, helping you to annotate your source tree with (Item)NotNull / (Item)CanBeNull attributes.
https://www.jetbrains.com/resharper/help/Code_Analysis__Code_Annotations.html
Apache License 2.0
26 stars 4 forks source link

Constructed array parameter from open generic interface with external annotation should not be reported #4

Closed bkoelman closed 9 years ago

bkoelman commented 9 years ago

Example:

public class C : ICollection<string>
{
    // ...
    public void CopyTo(string[] array, int arrayIndex) { ... }
}

Reports:

Annotate 'array' with [NotNull] or [CanBeNull].

Which is incorrect, because an external annotation exists for ICollection.CopyTo:

<member name="M:System.Collections.Generic.ICollection`1.CopyTo(`0[],System.Int32)">
    <parameter name="array">
      <attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
    </parameter>
  </member>

Because of this, Resharper grays out the annotation after manually adding it.