Skip to content

Mono inconsistency in error case when using ExplicitThis when defining constructor #113839

@steveharter

Description

@steveharter

This is a minor inconsistency for Mono compared to CoreClr found while adding tests for ExplicitThis calling convention, and this issue created mainly to add the [ActiveIssue] to test System.Reflection.Emit.Tests.TypeBuilderDefineConstructor.DefineConstructor_ExplicitThisCallingConventionsForInstanceMethod_ThrowsTypeLoadExceptionOnCreation()

That test does not fail on Mono, but on CoreClr fails with an expected TypeLoadException:

Unhandled exception. System.TypeLoadException: The signature is incorrect.
   at System.Reflection.Emit.RuntimeTypeBuilder.TermCreateClass(QCallModule module, Int32 tk, ObjectHandleOnStack type)
   at System.Reflection.Emit.RuntimeTypeBuilder.TermCreateClass(QCallModule module, Int32 tk, ObjectHandleOnStack type)
   at System.Reflection.Emit.RuntimeTypeBuilder.CreateTypeNoLock() in C:\git\rfp2\src\coreclr\System.Private.CoreLib\src\System\Reflection\Emit\RuntimeTypeBuilder.cs:line 1658
   at System.Reflection.Emit.RuntimeTypeBuilder.CreateTypeInfoImpl() in C:\git\rfp2\src\coreclr\System.Private.CoreLib\src\System\Reflection\Emit\RuntimeTypeBuilder.cs:line 1483
   at System.Reflection.Emit.RuntimeTypeBuilder.CreateTypeInfoCore() in C:\git\rfp2\src\coreclr\System.Private.CoreLib\src\System\Reflection\Emit\RuntimeTypeBuilder.cs:line 1473
   at System.Reflection.Emit.TypeBuilder.CreateTypeInfo() in C:\git\rfp2\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs:line 42
   at System.Reflection.Emit.TypeBuilder.CreateType() in C:\git\rfp2\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs:line 38

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions