Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaja R Harinath <harinath@hurrynot.org>2005-03-07 10:08:31 +0300
committerRaja R Harinath <harinath@hurrynot.org>2005-03-07 10:08:31 +0300
commit9070a4d8dc3cf058e9d732968a562aa1d5671dc5 (patch)
treeac6bc0f241f1ba6abc62623e4747c49e3d346a42 /mcs/errors/cs0120-6.cs
parent9235d3310826483718e154b226e49306c2f02869 (diff)
Fix #73394.
* mcs/ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that slipped in because of variable names that are identical to a builtin type's BCL equivalent ('string String;', 'int Int32;'). (PropertyExpr.EmitInstance): Likewise. * errors/cs0120-6.cs, errors/cs0120-7.cs: New tests from #73394. svn path=/trunk/mcs/; revision=41506
Diffstat (limited to 'mcs/errors/cs0120-6.cs')
-rw-r--r--mcs/errors/cs0120-6.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/mcs/errors/cs0120-6.cs b/mcs/errors/cs0120-6.cs
new file mode 100644
index 00000000000..82fc71bc42f
--- /dev/null
+++ b/mcs/errors/cs0120-6.cs
@@ -0,0 +1,14 @@
+// CS0120: An object reference is required for the non-static field `Int32'
+// Line: 11
+
+using System;
+
+public class MemRefMonoBug {
+ private int Int32; // this member has the same name as System.Int32 class
+ public static void Main ()
+ {
+ new MemRefMonoBug ().Int32 = 0; // this line causes no problem
+ Int32 = 0; // mcs crashes in this line
+ }
+}
+