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)

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


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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