GenAPI incorrectly generates collection-based interface implementation
See original GitHub issueWhen targeting System.Collections.Immutable.1.7.1, GenAPI generates a class implementation which doesn’t implement the interface that its member explicitly attempts to implement.
This illustrates the issue:
public sealed partial class ImmutableHashSet<T> : IEnumerable, ICollection
{
bool Generic.ICollection<T>.IsReadOnly { get { throw null; } }
}
This results in a build error:
error CS0540: 'ImmutableHashSet<T>.ICollection<T>.IsReadOnly': containing type does not implement interface 'ICollection<T>'
You can see that the generated class doesn’t implement any of the generic interfaces that it should:
public sealed class ImmutableHashSet<T> : IImmutableSet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IHashKeyCollection<T>, ICollection<T>, ISet<T>, ICollection, IStrongEnumerable<T, ImmutableHashSet<T>.Enumerator>
Issue Analytics
- State:
- Created 6 months ago
- Comments:24 (24 by maintainers)
Top Results From Across the Web
Can I tell typescript that an interface is actually implemented?
Class 'FooModel' incorrectly implements interface 'FooResponse'. Property 'test' is missing in type 'FooModel' but required in type 'FooResponse ...
Read more >what am I missing? : r/typescript
Hi everyone, I have an interface that I'm using to identify classes that interact ... Class 'Bam' incorrectly implements interface 'Foo'.
Read more >Correct implementation of an interface
I'm running a DQL mutation to populate the database. Since the interface itself should be queryable (and has an ID), I need to...
Read more >Interview Question - Adding Method to interface that has ...
This question doesn't really give enough information. Will the implementation for this new method be the same in all the classes? Do we...
Read more >Explicit Interface Implementation - C# Programming Guide
A class can implement interfaces that contain a member with the same signature in C#. Explicit implementation creates a class member ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is it possible you’re missing the reference that contains the definition for IList?Nevermind, got a repro using the latest. When not providing references the interface definition is actually omitted. When providing references I see the indexer get/set methods are not reduced to an indexer.
I tried this out on a few packages I was having troubles with earlier and it appears that the issue has been resolved.