This project is read-only.
1

Resolved

C# Compiler Regression with Visual Studio 2015

description

The following code compiles OK on VS2013 but fails with an error in VS2015 preview:
1>c:\users\hmansell\documents\visual studio 14\Projects\ConsoleApplication2\ConsoleApplication2\Program.cs(26,38,26,44): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Bar<T, V>.Create(Func<T, bool>)' and 'Program.Bar<T, V>.Create(Func<T, V>, Func<T, bool>)'
using System;

namespace ConsoleApplication2
{
    class Program
    {
        public class Foo {
            public static bool IsThing(Foo t) { return false; }

        }
        public class Bar<T, V> where T : class
        {
            public static Bar<T, V> Create(Func<T, bool> filter)
            {
                return null;
            }
            public static Bar<T, V> Create(Func<T, V> propertyPrev, Func<T, bool> filter = null)
            {
                return null;
            }

        }

        static void Main(string[] args)
        {
            var x = Bar<Foo, double>.Create(Foo.IsThing);
        }
    }
}

comments

angocke wrote Nov 19, 2014 at 11:04 PM

Fixed in changeset ec3c3222f7530bbbb853a0147917d3a3afed3124

hmansell wrote Nov 20, 2014 at 12:24 AM

Awesome, thanks!