using System;
public class Program
{
public static void Main()
Thing t = new();
object x = (object)t;
Test(x);
}
private static void Test<T>(T thing)
var x = thing switch
Thing something => something,
_ => throw new InvalidOperationException()
};
Console.WriteLine("Yes");
public class Thing
public Thing() {}
public string What => "Thing";