-
Notifications
You must be signed in to change notification settings - Fork 263
Created unit test for Windows-only resolver bug. #361
base: master
Are you sure you want to change the base?
Conversation
I assume on Windows, you load the MS.NET reference assemblies? |
I'm using .NET on Windows and Mono on Ubuntu. I haven't installed Mono on Windows. Visual Studio correctly resolves precedent to Also, I find it highly suspicious that removing the IsFaulted line can change the chosen overload. Either way, this is what I get (Windows results obtained with VS debugger, Linux results with MD). Test program: [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 resolveResult = Resolve<MethodGroupResolveResult>(program);
} //Insert breakpoint here On Windows NRefactory, the MethodGroupResolveResult of ContinueWith gives me 40 methods (0 extension methods, 2 method lists with 20 methods each).
NRefactory on Linux also gives me 40 methods, in 2 method lists:
Method list 2:
|
I've checked the resolve result of the whole invocation ( Windows (with the IsFaulted line):
Windows (without the IsFaulted line):
Linux:
So that pretty much confirms NRefactory is picking the wrong overload of ContinueWith on Windows. |
Here's the full resolver log: https://gist.github.com/dgrunwald/7442645 Note that |
Confirmed. Adding Still, I wonder why NRefactory on Linux recovers from this error when NRefactory on Windows fails. |
On Linux, this is the resolver log: https://gist.github.com/luiscubal/7548131 |
Added an unit test for a resolver bug that happens only on Windows (see #359).
Note that the resolver decides that precedent is of type
Task
, notTask<int>
but only on Windows. On Ubuntu, it correctly guesses the type of the precedent task.For extra weirdness, comment the
Console.WriteLine (precedent.IsFaulted);
line. Note that the bug will go away.Disclaimer: I'm not 100% sure my Windows and Linux systems are running the same IKVM/Cecil versions.