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-02-27 01:07:49 +0300
committerMiguel de Icaza <miguel@gnome.org>2002-02-27 01:07:49 +0300
commitdfb18226442668978cdd1ae2b5acee2e5ae53fdc (patch)
treedcd78075fb75d93fc7a0446a09f8d04fe2404cd6 /mcs/tests/test-79.cs
parent7443ac0f26eda12684c023380d6bd8fa97cb1e27 (diff)
2002-02-26 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Special case the `null' object when trying to auto-compute the type, as anything can be explicitly converted to that. Added test svn path=/trunk/mcs/; revision=2701
Diffstat (limited to 'mcs/tests/test-79.cs')
-rwxr-xr-xmcs/tests/test-79.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/mcs/tests/test-79.cs b/mcs/tests/test-79.cs
new file mode 100755
index 00000000000..8a4012db8ad
--- /dev/null
+++ b/mcs/tests/test-79.cs
@@ -0,0 +1,17 @@
+//
+// This test excercises the compiler being able to compute
+// correctly the return type in the presence of null (as null
+// will be implicitly convertible to anything
+//
+class X {
+
+ static int Main ()
+ {
+ object o = null;
+
+ string s = o == null ? "string" : null;
+ string d = o == null ? null : "string";
+
+ return 0;
+ }
+}