Bug 28661 - Compiler crash when compiling class with dynamic + overloads
Summary: Compiler crash when compiling class with dynamic + overloads
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-04-01 15:13 UTC by Alexander Köplinger
Modified: 2015-04-01 15:13 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
test.cs (1.00 KB, text/plain)
2015-04-01 15:13 UTC, Alexander Köplinger
Details

Description Alexander Köplinger 2015-04-01 15:13:13 UTC
Created attachment 10593 [details]
test.cs

Compiling the attached code results in the following crash when compiled with mcs:

>$ mcs test.cs 
>
>Unhandled Exception:
>Mono.CSharp.InternalErrorException: test.cs(51,14): Test.TestMethod<T>(ref T, T) ---> Mono.CSharp.InternalErrorException: test.cs(52,5): ---> Mono.CSharp.InternalErrorException: Missing member `Test.<TestMethod>c__DynamicSite0<T>.Container0' on inflated type `Test.<TestMethod>c__DynamicSite0<T>'
>  at Mono.CSharp.MemberCache.GetMember[TypeSpec] (Mono.CSharp.TypeSpec container, Mono.CSharp.TypeSpec spec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.DynamicExpressionStatement.EmitCall (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression binder, Mono.CSharp.Arguments arguments, Boolean isStatement) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.DynamicExpressionStatement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Arguments.Emit (Mono.CSharp.EmitContext ec, Boolean dup_args, Boolean prepareAwait) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.CallEmitter.EmitPredefined (Mono.CSharp.EmitContext ec, Mono.CSharp.MethodSpec method, Mono.CSharp.Arguments Arguments, Boolean statement, Nullable`1 loc) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.CallEmitter.Emit (Mono.CSharp.EmitContext ec, Mono.CSharp.MethodSpec method, Mono.CSharp.Arguments Arguments, Location loc) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.DelegateInvocation.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.DynamicExpressionStatement.EmitCall (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression binder, Mono.CSharp.Arguments arguments, Boolean isStatement) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.DynamicExpressionStatement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Return.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  --- End of inner exception stack trace ---
>  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
>  --- End of inner exception stack trace ---
>  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.TypeDefinition.EmitContainer () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.ModuleContainer.EmitContainer () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Note: this was extracted from the dynamics testsuite over at dotnet/corefx

Note You need to log in before you can comment on or make changes to this bug.