Bug 26840 - InternalErrorException on specifying Optional attribute
Summary: InternalErrorException on specifying Optional attribute
Status: RESOLVED FIXED
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-02-08 08:29 UTC by Leonid Shalupov
Modified: 2015-02-10 02:50 UTC (History)
1 user (show)

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


Attachments
Repro (293 bytes, text/plain)
2015-02-08 08:30 UTC, Leonid Shalupov
Details

Description Leonid Shalupov 2015-02-08 08:29:33 UTC
"mcs -unsafe b.cs" fails exception. See attached file for source.

Unhandled Exception:
Mono.CSharp.InternalErrorException: b.cs(4,11): test ---> Mono.CSharp.InternalErrorException: b.cs(6,29): test.MainClass ---> Mono.CSharp.InternalErrorException: b.cs(13,25): test.MainClass.FooDelegate ---> System.InvalidCastException: Cannot cast from source type to destination type.
  at Mono.CSharp.Parameter.ResolveDefaultValue (Mono.CSharp.ResolveContext rc) [0x00000] in <filename unknown>:0
  at Mono.CSharp.ParametersCompiled.ResolveDefaultValues (Mono.CSharp.MemberCore m) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Delegate.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeDefinition.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.CompilationSourceFile.PrepareEmit () [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
[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: b.cs(4,11): test ---> Mono.CSharp.InternalErrorException: b.cs(6,29): test.MainClass ---> Mono.CSharp.InternalErrorException: b.cs(13,25): test.MainClass.FooDelegate ---> System.InvalidCastException: Cannot cast from source type to destination type.
  at Mono.CSharp.Parameter.ResolveDefaultValue (Mono.CSharp.ResolveContext rc) [0x00000] in <filename unknown>:0
  at Mono.CSharp.ParametersCompiled.ResolveDefaultValues (Mono.CSharp.MemberCore m) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Delegate.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeDefinition.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.PrepareEmit () [0x00000] in <filename unknown>:0
  at Mono.CSharp.CompilationSourceFile.PrepareEmit () [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
Comment 1 Leonid Shalupov 2015-02-08 08:30:21 UTC
Created attachment 9697 [details]
Repro
Comment 2 Marek Safar 2015-02-10 02:50:11 UTC
Fixed in master

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