diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2005-03-07 10:08:31 +0300 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2005-03-07 10:08:31 +0300 |
commit | 9070a4d8dc3cf058e9d732968a562aa1d5671dc5 (patch) | |
tree | ac6bc0f241f1ba6abc62623e4747c49e3d346a42 /mcs/errors/cs0120-6.cs | |
parent | 9235d3310826483718e154b226e49306c2f02869 (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.cs | 14 |
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 + } +} + |