Created unit test for Windows-only resolver bug. #361
Loading…
Reference in a new issue
No description provided.
Delete branch "luiscubal/windows-only-resolver-bug"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added an unit test for a resolver bug that happens only on Windows (see https://github.com/icsharpcode/NRefactory/issues/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.
I assume on Windows, you load the MS.NET reference assemblies?
I'm thinking some methods might have additional overloads there that don't exist on Mono.
I'm using .NET on Windows and Mono on Ubuntu. I haven't installed Mono on Windows.
I'm using plain standard NRefactory as far as I'm aware.
Visual Studio correctly resolves precedent to
Task<int>, just like NRefactory on Linux. So even with any potential additional overloads the Linux solution is still the correct one.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:
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 (
CSharpInvocationResolveResult) and I get: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
Consolecannot be resolved, due to a missingusing System;Once that is added, the resolver picks the correct overload and the test passes.Confirmed. Adding
using System;does fix this problem (and the AutoAsyncTests as well).I'll update my other pull request.
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.