You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@ -1,5 +1,3 @@
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
using System;
|
||||
|
||||
class TypePattern
|
||||
@ -8,31 +6,14 @@ class TypePattern
|
||||
{
|
||||
object o = 3;
|
||||
bool r = o is System.String t1;
|
||||
if (t1 != null)
|
||||
return 1;
|
||||
|
||||
if (r)
|
||||
return 2;
|
||||
|
||||
if (o is string t2)
|
||||
return 3;
|
||||
|
||||
if (t2 != null)
|
||||
return 4;
|
||||
|
||||
object o2 = (int?) 4;
|
||||
bool r2 = o2 is byte? t3;
|
||||
|
||||
if (t3 != null)
|
||||
return 5;
|
||||
|
||||
if (r2)
|
||||
return 6;
|
||||
|
||||
long? l = 5;
|
||||
bool r3 = l is long t4;
|
||||
if (t4 != 5)
|
||||
return 7;
|
||||
|
||||
if (!r3)
|
||||
return 8;
|
||||
@ -40,4 +21,22 @@ class TypePattern
|
||||
Console.WriteLine ("ok");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Test1 (object arg)
|
||||
{
|
||||
while (arg is int b) {
|
||||
b = 2;
|
||||
}
|
||||
}
|
||||
|
||||
static string Test2 (object arg)
|
||||
{
|
||||
if (arg is string s) {
|
||||
return s;
|
||||
} else {
|
||||
s = "";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user