using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication6 { class Program { public static ArgumentException FM(object s) { return new ArgumentException("aru"); } static void Main(string[] args) { //逆变和协变 Func<object, ArgumentException> fn1 = FM; Func<string, Exception> fn2 = fn1; //里氏原则 Exception=ArgumentException 父类引用=子类对象的实例引用 Exception ret2= fn2("1"); ArgumentException ret1= fn1("1"); //ty的返回类型ArgumentException var ty2 = ret2.GetType(); var ty1 = ret1.GetType(); //两个的实际类型都是System.ArgumentException Console.WriteLine("ty1:"+ty1.ToString()+" ty2:"+ty2.ToString()); Console.ReadKey(); } } } 原理图如下: