linux-packaging-mono/mcs/tests/gtest-linq-15.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

28 lines
445 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
namespace NameCollisionTest
{
class Data
{
public int Value;
}
static class Ex
{
public static IEnumerable<TR> Foo<T, TR> (this IEnumerable<T> t, Func<T, TR> f)
{
yield return f (t.First ());
}
}
public class C
{
public static void Main ()
{
Data [] i = new Data [0];
var prods = from pe in i.Foo (pe => pe.Value) where pe > 0 select pe;
}
}
}