コード例 #1
0
ファイル: main_package_I.cs プロジェクト: kevinmiles/go2cs
 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}");
     }
 }