public static ref T TypeAssert <T>(this main_package.I target) { try { return(ref ((main_package.I <T>)target).Target); } catch (NotImplementedException ex) { throw new PanicException($"panic: interface conversion: {target.GetType().FullName} is not {typeof(T).FullName}: missing method {ex.InnerException?.Message}"); } }