[Mono-bugs] [Bug 36229][Wis] New - assignement to const does not result in proper error but in exception
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
2 Jan 2003 08:45:02 -0000
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 max.stekelenburg@nl.yachtgroup.com.
http://bugzilla.ximian.com/show_bug.cgi?id=36229
--- shadow/36229 Thu Jan 2 03:45:02 2003
+++ shadow/36229.tmp.16994 Thu Jan 2 03:45:02 2003
@@ -0,0 +1,80 @@
+Bug#: 36229
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: max.stekelenburg@nl.yachtgroup.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: assignement to const does not result in proper error but in exception
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+assignment to a const results in an exception instead of generating CS0131
+
+Steps to reproduce the problem:
+Compile the following code
+
+//should generate (according to o'reilly:programming c#)
+//error CS0131: The left-hand side of an assignment must be a variable,
+property or indexer
+class Values {
+ static void Main () {
+ const int myInt = 1;
+
+ myInt = 2;
+ }
+}
+
+Actual Results:
+Exception caught by the compiler while compiling:
+ Block that caused the problem begin at: CS0131.cs: (4)
+ Block being compiled: [CS0131.cs: (4),CS0131.cs: (8)]
+
+Unhandled Exception: System.Exception: Expression
+Mono.CSharp.LocalVariableReference did not set its type after Resolve
+in <0x001f2> 00 Mono.CSharp.Expression:ResolveLValue
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression)
+in <0x000e3> 00 Mono.CSharp.SimpleName:SimpleNameResolve
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression,bool)
+in <0x0001d> 00 Mono.CSharp.SimpleName:DoResolveLValue
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression)
+in <0x0002a> 00 Mono.CSharp.Expression:ResolveLValue
+(Mono.CSharp.EmitContext,Mono.CSharp.Expression)
+in <0x00298> 00 Mono.CSharp.Assign:DoResolve (Mono.CSharp.EmitContext)
+in <0x0014a> 00 Mono.CSharp.Expression:Resolve
+(Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags)
+in <0x0001d> 00 Mono.CSharp.StatementExpression:Resolve
+(Mono.CSharp.EmitContext)
+in <0x00257> 00 Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext)
+in <0x00104> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x00342> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x005c2> 00 Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Block,object)
+in <0x00023> 00 Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x00291> 00 Mono.CSharp.TypeContainer:Emit ()
+in <0x004de> 00 Mono.CSharp.RootContext:EmitCode ()
+in <0x00718> 00 Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000f> 00 Mono.CSharp.Driver:Main (string[])
+
+
+
+Expected Results:
+error CS0131: The left-hand side of an assignment must be a variable,
+property or indexer
+
+How often does this happen?
+allways
+
+Additional Information: