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:
authorMarek Safar <marek.safar@gmail.com>2011-04-20 13:20:14 +0400
committerMarek Safar <marek.safar@gmail.com>2011-04-20 13:20:32 +0400
commit987cef8a1cfe52927dccca1e1e0345c72c69c131 (patch)
tree18944681d10f2d86ce2e787cecac5b1eb4e72a1a /mcs/tests/gtest-117.cs
parent5c306c5d0421907d8845c6e7f1b3abbf44937247 (diff)
[688651] Fix nullable enum values used with probing operator
Diffstat (limited to 'mcs/tests/gtest-117.cs')
-rw-r--r--mcs/tests/gtest-117.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/mcs/tests/gtest-117.cs b/mcs/tests/gtest-117.cs
index 1e07e91cf03..b4d21c9746a 100644
--- a/mcs/tests/gtest-117.cs
+++ b/mcs/tests/gtest-117.cs
@@ -2,6 +2,8 @@
using System;
+enum E { Item };
+
public interface IFoo<T>
{ }
@@ -50,12 +52,22 @@ class X
{
int? i = null;
if (i is int) {
- return (int) i;
+ return (int) i;
}
return 3;
}
+ static bool Check1 (E? e)
+ {
+ return e is Enum;
+ }
+
+ static bool Check2<T> (E e) where T : struct
+ {
+ return e is T;
+ }
+
static int Main ()
{
if (Foo<int>.Test (3))
@@ -79,6 +91,15 @@ class X
if (TestC () != 3)
return 6;
+ if (Check1 (null))
+ return 7;
+
+ if (!Check1 (E.Item))
+ return 8;
+
+ if (Check2<int> (E.Item))
+ return 9;
+
Console.WriteLine ("OK");
return 0;
}