From 5373ed30cd23851501c6d273aa0793b5e9902845 Mon Sep 17 00:00:00 2001 From: Llewellyn Pritchard Date: Thu, 26 Nov 2015 17:31:38 +0200 Subject: [PATCH] Fixes #7081 for LambdaTests.cs --- .../CSharp/Test/Semantic/Semantics/LambdaTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs index d17764d5649..2a1bc3a5b4b 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs @@ -218,14 +218,14 @@ void M() } }"; var compilation = CreateCompilationWithMscorlib(code); - compilation.VerifyDiagnostics(); + compilation.VerifyDiagnostics(); // no errors expected } [WorkItem(539538, "DevDiv")] [Fact] public void TestLambdaErrors03() { - TestErrors(@" + string source = @" using System; interface I : IComparable> { } @@ -239,8 +239,11 @@ static void M() Foo(() => null); } } -", -"'Foo' error CS0121: The call is ambiguous between the following methods or properties: 'C.Foo(Func>)' and 'C.Foo(Func)'"); +"; + CreateCompilationWithMscorlib(source).VerifyDiagnostics( + // (12,9): error CS0121: The call is ambiguous between the following methods or properties: 'C.Foo(Func>)' and 'C.Foo(Func)' + // Foo(() => null); + Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("C.Foo(System.Func>)", "C.Foo(System.Func)").WithLocation(12, 9)); } [WorkItem(539976, "DevDiv")] -- GitLab