Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@ -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;
}
}