linux-packaging-mono/mcs/tests/test-pattern-12.cs
Xamarin Public Jenkins (auto-signing) e46a49ecf1 Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
2018-01-24 17:04:36 +00:00

38 lines
520 B
C#

using System;
using System.Collections.Generic;
class X
{
public static int Main ()
{
foreach (var x in Test1 ("2"))
{
Console.WriteLine (x);
return 1;
}
foreach (var x in Test2 (2))
{
Console.WriteLine (x);
return 2;
}
return 0;
}
public static IEnumerable<object> Test1 (object expr)
{
if (expr is short list)
{
yield return "list.Length";
}
}
public static IEnumerable<object> Test2 (object expr)
{
if (expr is string list)
{
yield return "list.Length";
}
}
}