using System;
abstract class TySub
{
public abstract B Cast(A a);
}
class TySub_Refl : TySub
where A : B
{
public override B Cast(A a)
{
return a;
}
}
static class TySub_Helper
{
public static TySub Refl()
where A : B
{
return new TySub_Refl();
}
}
[SharpLab.Runtime.JitGeneric(typeof(string))]
class Hello
{
public void Store(TySub ts, T value)
{
var c = ts.Cast(value);
c.Clone();
}
}
public static class C
{
public static void M()
{
var hello = new Hello();
hello.Store(new TySub_Refl(), "what");
}
}