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
// lib1.cs
public abstract class TaskInput<TKey, TValue>
where TKey : class
where TValue : class
{
public virtual TValue this[TKey key] => throw null;
}
// lib2.cs
public class CallNode { }
public sealed class CalleeCallNodeInput<TValue> : TaskInput<CallNode, TValue>
where TValue : class
{
public override TValue this[CallNode key] => throw null;
}
// data.cs
class FunctionSummary { }
class Repro
{
void M()
{
CalleeCallNodeInput<FunctionSummary> c = null;
CallNode node = null;
var summary = c[node];
}
static void Main(){ }
}
Repro steps:
> csc lib1.cs /t:library
> csc lib2.cs /t:library /r:lib1.dll
> csc data.cs /r:lib1.dll /r:lib2.dll
data.cs(10,27): error CS0121: The call is ambiguous between the following methods or properties: 'TaskInput<TKey, TValue>.this[TKey]' and 'TaskInput<TKey, TValue>.this[TKey]'
This should compile without error or warnings. Likely this is a regession from covariant returns.
The text was updated successfully, but these errors were encountered:
Repro code
Repro steps:
This should compile without error or warnings. Likely this is a regession from covariant returns.
The text was updated successfully, but these errors were encountered: