Consulo is not inferring the type from the where constraint in this use of generics. We noticed this when debugging the core of one of our algorithm's today. Luckily it was easy to reproduce in a single script. As can be seen, it does compile and run even though consulo says there is an error. The error says: "Cannot implicitly convert type 'T1' to 'ISomeInterface' ".
using System;
public class Program
{
public static void Main(String[] args)
{
Console.WriteLine("Hello World!!!");
}
}
public interface ISomeInterface<T>
{
}
public interface ISomeInterface2<T1, T2> where T1 : ISomeInterface<T2>
{
}
public class SomeClass<T1, T2> where T1 : ISomeInterface<T2>
{
public void SomeMethod(T1 arg)
{
var someClass = new SomeGenericClass<T2>();
someClass.someOtherInterfaceT = arg;
}
}
public class SomeGenericClass<T>
{
public ISomeInterface<T> someOtherInterfaceT;
}
Consulo is not inferring the type from the' ".
where
constraint in this use of generics. We noticed this when debugging the core of one of our algorithm's today. Luckily it was easy to reproduce in a single script. As can be seen, it does compile and run even though consulo says there is an error. The error says: "Cannot implicitly convert type 'T1' to 'ISomeInterfaceOS: Ubuntu 18.04 consulo.log
About Info