--- /dev/null
+// CS0150: A constant value is expected
+// Line : 14
+
+using System;
+
+public class Blah
+{
+ static readonly string Test;
+
+ public static void Main ()
+ {
+ string s = null;
+ switch (s) {
+ case Blah.Test:
+ break;
+ }
+ }
+}
Constant c = expr as Constant;
if (c == null) {
- if (c.type != InternalType.ErrorType)
- rc.Report.Error (150, StartLocation, "A constant value is expected");
+ if (expr.type != InternalType.ErrorType)
+ rc.Report.Error (150, expr.StartLocation, "A constant value is expected");
return null;
}