/// <summary> /// Pops a reference from the evaluation stack, and pushes a reference of the given type if the object is an instance of that type, otherwise an <see cref="InvalidCastException" /> is thrown /// </summary> /// <typeparam name="T">The type to attempt to cast to</typeparam> /// <param name="generator">The <see cref="T:System.Reflection.Emit.XsILGenerator" /> to emit instructions from</param> public static XsILGenerator CastClass <T>(this XsILGenerator generator) where T : class => generator.CastClass(typeof(T));