
public static TypeInfo GetTypeInfo(this Type type){ if (type == (Type) null) throw new ArgumentNullException("type"); IReflectableType reflectableType = (IReflectableType) type; if (reflectableType == null) return (TypeInfo) null; // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< HERE! else return reflectableType.GetTypeInfo();} 为什么这种方法无法访问代码?这是一个错误还是故意做的?
解决方法 混淆是由Type类上定义的==运算符引起的.如果查看IL,您将看到调用运算符而不是ReferenceEquals.
L_0002: call bool System.Type::op_Equality(class System.Type,class System.Type)
所以代码实际上是可以达到的:)
总结以上是内存溢出为你收集整理的c# – 为什么System.Reflection.IntrospectionExtensions.GetTypeInfo有无法访问的代码?全部内容,希望文章能够帮你解决c# – 为什么System.Reflection.IntrospectionExtensions.GetTypeInfo有无法访问的代码?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)