diff options
author | Miguel de Icaza <miguel@gnome.org> | 2002-02-27 01:07:49 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2002-02-27 01:07:49 +0300 |
commit | dfb18226442668978cdd1ae2b5acee2e5ae53fdc (patch) | |
tree | dcd78075fb75d93fc7a0446a09f8d04fe2404cd6 /mcs/tests/test-79.cs | |
parent | 7443ac0f26eda12684c023380d6bd8fa97cb1e27 (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-x | mcs/tests/test-79.cs | 17 |
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; + } +} |