未验证 提交 39e080d5 编写于 作者: S Stephen Toub 提交者: GitHub

Fix TypeBuilder's base type in ref (#42947)

* Fix Type/Enum/GenericTypeParameterBuilders' base types in ref

* Fix mono's EnumBuilder.IsAssignableFrom implementation

With the ref change, a test started failing because the C# compiler started generating a call to TypeInfo's IsAssignableFrom(TypeInfo) rather than Type's IsAssignableFrom(TypeInfo).
上级 2a20b1aa
......@@ -84,7 +84,7 @@ public sealed partial class ConstructorBuilder : System.Reflection.ConstructorIn
public void SetImplementationFlags(System.Reflection.MethodImplAttributes attributes) { }
public override string ToString() { throw null; }
}
public sealed partial class EnumBuilder : System.Type
public sealed partial class EnumBuilder : System.Reflection.TypeInfo
{
internal EnumBuilder() { }
public override System.Reflection.Assembly Assembly { get { throw null; } }
......@@ -192,7 +192,7 @@ public sealed partial class FieldBuilder : System.Reflection.FieldInfo
public void SetOffset(int iOffset) { }
public override void SetValue(object? obj, object? val, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, System.Globalization.CultureInfo? culture) { }
}
public sealed partial class GenericTypeParameterBuilder : System.Type
public sealed partial class GenericTypeParameterBuilder : System.Reflection.TypeInfo
{
internal GenericTypeParameterBuilder() { }
public override System.Reflection.Assembly Assembly { get { throw null; } }
......@@ -422,7 +422,7 @@ public sealed partial class PropertyBuilder : System.Reflection.PropertyInfo
public override void SetValue(object? obj, object? value, object?[]? index) { }
public override void SetValue(object? obj, object? value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? index, System.Globalization.CultureInfo? culture) { }
}
public sealed partial class TypeBuilder : System.Type
public sealed partial class TypeBuilder : System.Reflection.TypeInfo
{
internal TypeBuilder() { }
public const int UnspecifiedTypeSize = 0;
......
......@@ -471,7 +471,8 @@ public override bool IsConstructedGenericType
public override bool IsAssignableFrom([NotNullWhen(true)] TypeInfo? typeInfo)
{
return base.IsAssignableFrom(typeInfo);
if (typeInfo == null) return false;
return IsAssignableFrom(typeInfo.AsType());
}
public override bool IsTypeDefinition => true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册