You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System.Collections;using System.Collections.Generic;classMyCollection<T>:IEnumerable<T>{IEnumerator<T>IEnumerable<T>.GetEnumerator()=>thrownull;
IEnumerator IEnumerable.GetEnumerator()=>thrownull;}staticclassExtensionsA{publicstaticvoidAdd<T>(thisMyCollection<T>collection,paramsstring[] args){}}staticclassExtensionsB{publicstaticvoidAdd<T>(thisMyCollection<T>collection,paramsstring[] args){}}classProgram{staticvoidMain(){varx=newMyCollection<object>();
x.Add("");vary=newMyCollection<object>{""};}}
Expected Behavior:
The following errors are expected, as reported by 4.10.0-3.24161.9 (b0be498).
(25,11): error CS0121: The call is ambiguous between the following methods or properties:
'ExtensionsA.Add<T>(MyCollection<T>, params string[])' and
'ExtensionsB.Add<T>(MyCollection<T>, params string[])'
(27,44): error CS0121: The call is ambiguous between the following methods or properties:
'ExtensionsA.Add<T>(MyCollection<T>, params string[])' and
'ExtensionsB.Add<T>(MyCollection<T>, params string[])'
Actual Behavior:
No errors.
The text was updated successfully, but these errors were encountered:
It looks like IsBetterCollectionExpressionConversion is not designed to be called with identical type, which happens for params scenario from IsBetterParamsCollectionType.
Version Used:
main: 7ecf61f
Steps to Reproduce:
Compile the following:
Expected Behavior:
The following errors are expected, as reported by 4.10.0-3.24161.9 (b0be498).
Actual Behavior:
No errors.
The text was updated successfully, but these errors were encountered: