Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Created unit test for Windows-only resolver bug. #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ICSharpCode.NRefactory.Tests/CSharp/Resolver/LambdaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ public SomeClass(Action<T> ac) { }
var lrr = Resolve<LocalResolveResult>(program);
Assert.AreEqual("System.String", lrr.Type.ReflectionName);
}

[Test]
public void LambdaTaskParameterTest()
{
string program = @"using System.Threading.Tasks;

class TestClass {
public void TestMethod () {
Task<int> foo = null;
foo.ContinueWith($precedent => {
Console.WriteLine (precedent.IsFaulted);
}$);
}
}";

var lambdaResolveResult = Resolve<LambdaResolveResult>(program);

//Precedent must be of type Task<int>, not just Task
Assert.IsTrue(lambdaResolveResult.Parameters[0].Type.IsParameterized);
}

#region Lambda In Array Initializer
[Test]
Expand Down