[mcs] Adds handling for declared variables from while loop condition
[mono.git] / mcs / mcs / const.cs
index 7d149aae26ce24758c2c19e1f58d12f6e46468d8..046aec24c1b18b8bb3619e23a5a899bbb074f27a 100644 (file)
@@ -100,12 +100,23 @@ namespace Mono.CSharp {
                {
                        if (t.IsGenericParameter) {
                                Report.Error (1959, loc,
-                                       "Type parameter `{0}' cannot be declared const", TypeManager.CSharpName (t));
+                                       "Type parameter `{0}' cannot be declared const", t.GetSignatureForError ());
                        } else {
                                Report.Error (283, loc,
-                                       "The type `{0}' cannot be declared const", TypeManager.CSharpName (t));
+                                       "The type `{0}' cannot be declared const", t.GetSignatureForError ());
                        }
                }
+
+               public override void Accept (StructuralVisitor visitor)
+               {
+                       visitor.Visit (this);
+               }
+
+               public override void PrepareEmit ()
+               {
+                       base.PrepareEmit ();
+                       DefineValue ();
+               }
        }
 
        public class ConstSpec : FieldSpec