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:
authorMiguel de Icaza <miguel@gnome.org>2002-03-12 05:41:25 +0300
committerMiguel de Icaza <miguel@gnome.org>2002-03-12 05:41:25 +0300
commit5558fee0ba4b74c6ad5e1dba66f0183e5b5a96fe (patch)
treedb0f451aac17dde7223ef4991ac99b0834bcd159 /mcs/tests/test-84.cs
parent77a0495a3298a861e0f3ab1f4811962023de0fc0 (diff)
2002-03-12 Miguel de Icaza <miguel@ximian.com>
* class.cs: Only report 108 if there is no `new' modifier. * cs-parser.jay: rework foreach statement to work with the new changes to the policy on SimpleNames. * report.cs: support Stacktrace on warnings as well. * makefile: drop --unsafe and /unsafe from the compile. 2002-03-11 Miguel de Icaza <miguel@ximian.com> * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable lookups here, instead of doing that at parse time. This means that our grammar will not introduce `LocalVariableReferences' as expressions at this point. That solves the problem of code like this: class X { static void Main () { int X = 1; { X x = null }}} This is only half the fix. The full fix requires parameters to also be handled in this way. Added test for the above new scenario, updated our foreach tests to try the new changes. svn path=/trunk/mcs/; revision=3059
Diffstat (limited to 'mcs/tests/test-84.cs')
-rwxr-xr-xmcs/tests/test-84.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/mcs/tests/test-84.cs b/mcs/tests/test-84.cs
new file mode 100755
index 00000000000..e6b3d4e3f0d
--- /dev/null
+++ b/mcs/tests/test-84.cs
@@ -0,0 +1,22 @@
+//
+// This test shows how a variable can be created with the
+// same name as the class, and then the class referenced again
+//
+// This was a bug exposed by Digger, as we incorrectly tried to
+// do some work ahead of time during the resolution process
+// (ie, we created LocalVariableReferences for the int variable `Ghost',
+// which stopped `Ghost' from being useful as a type afterwards
+//
+
+class Ghost {
+
+ static int Main ()
+ {
+ int Ghost = 0;
+
+ if (true){
+ Ghost g = null;
+ }
+ return 0;
+ }
+}