diff options
author | Miguel de Icaza <miguel@gnome.org> | 2002-05-18 00:13:44 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2002-05-18 00:13:44 +0400 |
commit | 3cd86625e7059cfea0f4ca7505b33a53131d53e2 (patch) | |
tree | 587f290e8b4bbd272b7a889003f02f727375a298 /mcs/tests/test-123.cs | |
parent | 6e3ae7ed4ae40268c51c5d543264dfd04ed4ee50 (diff) |
2002-05-17 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (ExplicitReferenceConversionExists): Made public.
(ImplicitReferenceConversionExists): Split out from
StandardConversionExists.
* expression.cs (As): We were only implementing one of the three
cases for the as operator. We now implement them all.
(Is): Implement the various other cases for Is as well.
* typemanager.cs (CACHE): New define used to control if we want or
not the FindMembers cache. Seems to have a negative impact on
performance currently
(MemberLookup): Nested types have full acess to
enclosing type members
Remove code that coped with instance/static returns for events, we
now catch this in RealFindMembers.
(RealFindMembers): only perform static lookup if the instance
lookup did not return a type or an event.
svn path=/trunk/mcs/; revision=4724
Diffstat (limited to 'mcs/tests/test-123.cs')
-rwxr-xr-x | mcs/tests/test-123.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/mcs/tests/test-123.cs b/mcs/tests/test-123.cs new file mode 100755 index 00000000000..87f7dbbfe01 --- /dev/null +++ b/mcs/tests/test-123.cs @@ -0,0 +1,47 @@ +class X { + + static object get_non_null () + { + return new X (); + } + + static object get_null () + { + return null; + } + + static int Main () + { + int a = 5; + object o; + decimal d = 0M; + + // + // compile time + // + if (!(get_non_null () is object)) + return 1; + + if (get_null () is object) + return 2; + + if (!(a is object)) + return 3; + + // + // explicit reference + // + if (null is object) + return 4; + + o = a; + if (!(o is int)) + return 5; + + if (d is int) + return 6; + + System.Console.WriteLine ("Is tests pass"); + return 0; + } +} |