@@ -2042,6 +2042,56 @@ public class PublicClass { }
20422042 expected : expected ,
20432043 includeInternalSymbols : includeInternalSymbols ) ;
20442044 }
2045+
2046+ [ Fact ]
2047+ public void TestGenericClassImplementsGenericInterface ( )
2048+ {
2049+ RunTest ( original : """
2050+ using System;
2051+ namespace A
2052+ {
2053+ public class Foo<T> : System.Collections.ICollection, System.Collections.Generic.ICollection<T>
2054+ {
2055+ int System.Collections.Generic.ICollection<T>.Count => throw new NotImplementedException();
2056+ bool System.Collections.Generic.ICollection<T>.IsReadOnly => throw new NotImplementedException();
2057+ int System.Collections.ICollection.Count => throw new NotImplementedException();
2058+ bool System.Collections.ICollection.IsSynchronized => throw new NotImplementedException();
2059+ object System.Collections.ICollection.SyncRoot => throw new NotImplementedException();
2060+ void System.Collections.Generic.ICollection<T>.Add(T item) => throw new NotImplementedException();
2061+ void System.Collections.Generic.ICollection<T>.Clear() => throw new NotImplementedException();
2062+ bool System.Collections.Generic.ICollection<T>.Contains(T item) => throw new NotImplementedException();
2063+ void System.Collections.Generic.ICollection<T>.CopyTo(T[] array, int arrayIndex) => throw new NotImplementedException();
2064+ bool System.Collections.Generic.ICollection<T>.Remove(T item) => throw new NotImplementedException();
2065+ System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() => throw new NotImplementedException();
2066+ void System.Collections.ICollection.CopyTo(System.Array array, int index) => throw new NotImplementedException();
2067+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => throw new NotImplementedException();
2068+
2069+ }
2070+ }
2071+
2072+ """ ,
2073+ expected : """
2074+ namespace A
2075+ {
2076+ public partial class Foo<T> : System.Collections.ICollection, System.Collections.Generic.ICollection<T>
2077+ {
2078+ int System.Collections.Generic.ICollection<T>.Count { get { throw null; } }
2079+ bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
2080+ int System.Collections.ICollection.Count { get { throw null; } }
2081+ bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
2082+ object System.Collections.ICollection.SyncRoot { get { throw null; } }
2083+ void System.Collections.Generic.ICollection<T>.Add(T item) { }
2084+ void System.Collections.Generic.ICollection<T>.Clear() { }
2085+ bool System.Collections.Generic.ICollection<T>.Contains(T item) { throw null; }
2086+ void System.Collections.Generic.ICollection<T>.CopyTo(T[] array, int arrayIndex) { }
2087+ bool System.Collections.Generic.ICollection<T>.Remove(T item) { throw null; }
2088+ System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; }
2089+ void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
2090+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
2091+ }
2092+ }
2093+ """ ,
2094+ includeInternalSymbols : false ) ;
2095+ }
20452096 }
20462097}
2047-
0 commit comments