The following code will compile in MSBuild12, but will fail in MSBuild15
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Example
{
public class List<T> : IEnumerable<T>
{
private readonly T[] _items;
public List(params T[] items)
{
_items = items;
}
public List(params List<T>[] args)
{
_items = args.SelectMany(t => t).ToArray();
}
public static List<T> New
{
get { return new List<T>(); }
}
public IEnumerator<T> GetEnumerator()
{
foreach (var item in _items)
yield return item;
}
IEnumerator IEnumerable.GetEnumerator()
{
return _items.GetEnumerator();
}
}
}
Result
CS0121 The call is ambiguous between the following methods or properties: 'List.List(params T[])' and 'List.List(params List[])' Example D:\Example\Test.cs