Beef
Beef copied to clipboard
Order of methods can cause errors
The code below doesn't compile, but it compiles fine if you swap the Test method overloads.
static String[?] ars = .("1", "2");
public static void Test<TEnum, TSource, TPredicate>(this TEnum items, TPredicate predicate)
where TEnum : concrete, IEnumerator<TSource>
where TPredicate : delegate bool(TSource)
{
}
public static void Test<TEnum, TSource, TPredicate>(this TEnum items, TPredicate predicate)
where TEnum : concrete, IEnumerable<TSource>
where TPredicate : delegate bool(TSource)
{
}
public static void Main()
{
ars.Test((i) => i != null);
}
Tested with: https://github.com/beefytech/Beef/commit/d3ca45d80abf49193709e9627646451d9aac0cbc