From 3ce09d002c818c2d6bdf6e054798859e2fbc5ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Reis?= Date: Tue, 12 Nov 2013 16:19:25 +0000 Subject: [PATCH] Created unit test for Windows-only resolver bug. --- .../CSharp/Resolver/LambdaTests.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LambdaTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LambdaTests.cs index 97c7f73a2..efaf5e535 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LambdaTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LambdaTests.cs @@ -77,6 +77,26 @@ public SomeClass(Action ac) { } var lrr = Resolve(program); Assert.AreEqual("System.String", lrr.Type.ReflectionName); } + + [Test] + public void LambdaTaskParameterTest() + { + string program = @"using System.Threading.Tasks; + +class TestClass { + public void TestMethod () { + Task foo = null; + foo.ContinueWith($precedent => { + Console.WriteLine (precedent.IsFaulted); + }$); + } +}"; + + var lambdaResolveResult = Resolve(program); + + //Precedent must be of type Task, not just Task + Assert.IsTrue(lambdaResolveResult.Parameters[0].Type.IsParameterized); + } #region Lambda In Array Initializer [Test]