[Mono-bugs] [Bug 69337][Min] New - mcs crashes on "const MyEnum foo = 0;"

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 10 Nov 2004 16:15:23 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by danw@novell.com.

http://bugzilla.ximian.com/show_bug.cgi?id=69337

--- shadow/69337	2004-11-10 16:15:23.000000000 -0500
+++ shadow/69337.tmp.13354	2004-11-10 16:15:23.000000000 -0500
@@ -0,0 +1,38 @@
+Bug#: 69337
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: danw@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs crashes on "const MyEnum foo = 0;"
+
+danw@twelve-monkeys:tmp> cat enum.cs
+public enum Foo { Bar };
+
+public class Test {
+	const Foo foo = 0;
+}
+danw@twelve-monkeys:tmp> mcs enum.cs
+enum.cs(4) error CS0029: Cannot convert implicitly from `int' to `Foo'
+ 
+Unhandled Exception: System.Exception: LookupConstantValue: This should
+never be reached System.Int32 Foo
+in <0x0017a> Mono.CSharp.Const:ChangeType
+(Mono.CSharp.Location,Mono.CSharp.Constant,System.Type)
+in <0x003ee> Mono.CSharp.Const:LookupConstantValue (object&)
+in <0x0001f> Mono.CSharp.Const:Emit ()
+in <0x000a8> Mono.CSharp.TypeContainer:EmitConstants ()
+in <0x0052a> Mono.CSharp.TypeContainer:EmitType ()
+in <0x0045c> Mono.CSharp.RootContext:EmitCode ()
+in <0x00cd9> Mono.CSharp.Driver:MainDriver (string[])
+in <0x00019> Mono.CSharp.Driver:Main (string[])