提交 5373ed30 编写于 作者: L Llewellyn Pritchard

Fixes #7081 for LambdaTests.cs

上级 4fc42f26
...@@ -218,14 +218,14 @@ void M() ...@@ -218,14 +218,14 @@ void M()
} }
}"; }";
var compilation = CreateCompilationWithMscorlib(code); var compilation = CreateCompilationWithMscorlib(code);
compilation.VerifyDiagnostics(); compilation.VerifyDiagnostics(); // no errors expected
} }
[WorkItem(539538, "DevDiv")] [WorkItem(539538, "DevDiv")]
[Fact] [Fact]
public void TestLambdaErrors03() public void TestLambdaErrors03()
{ {
TestErrors(@" string source = @"
using System; using System;
interface I : IComparable<IComparable<I>> { } interface I : IComparable<IComparable<I>> { }
...@@ -239,8 +239,11 @@ static void M() ...@@ -239,8 +239,11 @@ static void M()
Foo(() => null); Foo(() => null);
} }
} }
", ";
"'Foo' error CS0121: The call is ambiguous between the following methods or properties: 'C.Foo(Func<IComparable<I>>)' and 'C.Foo(Func<I>)'"); CreateCompilationWithMscorlib(source).VerifyDiagnostics(
// (12,9): error CS0121: The call is ambiguous between the following methods or properties: 'C.Foo(Func<IComparable<I>>)' and 'C.Foo(Func<I>)'
// Foo(() => null);
Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("C.Foo(System.Func<System.IComparable<I>>)", "C.Foo(System.Func<I>)").WithLocation(12, 9));
} }
[WorkItem(539976, "DevDiv")] [WorkItem(539976, "DevDiv")]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册