Mono inconsistency in error case when using ExplicitThis when defining constructor

Open
#113,839 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
testing

Research direction

Search the runtime test sources for System.Reflection.Emit.Tests.TypeBuilderDefineConstructor.DefineConstructor_ExplicitThisCallingConventionsForInstanceMethod_ThrowsTypeLoadExceptionOnCreation(). Start by running this test on Mono and CoreCLR to confirm the differing outcomes. Add the [ActiveIssue] annotation as described, then rerun the relevant test to verify the expected failure is tracked on Mono.

Written by the indexing model from the issue text.

Description

area-VM-meta-mono

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
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.