-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referencing multiple assemblies can trigger TypeError when calling an extension method #810
Comments
Interestingly, it works fine in ipy3. |
Sorry, false alarm , I see label "core" now. |
It seems that on .NET Core, I am not sure what should be a desired behaviour here; should overloads from one DLL hide extension methods of matching signature defined in another DLL? Any order of priority? |
My initial reaction to the issue is that if the user was loading two different versions of an assembly I would just say fix your code. But in this case they're loading |
@slozier I think I agree with you: if two or more assemblies export extension methods with the same signature, then it is a legitimate "ambiguous call" case and the error message is warranted (I wish it were more informative, though). However, if it just a case of a simple type forwarding, then |
A sidenote is that it worked up until 2.7.9 and then stopped working from 2.7.10 and forward. |
@Simon900225 Were you using 2.7.9 with .NET Core? |
Yes, with .NET 6. But I guess that it's running with help of the "compatibility layer" then as 2.7.9 is not built with .NET core as a target. |
Ok, 2.7.9 has a .NET Core 2.1 target so I assume .NET 6 will use those assemblies. I'll have to see what changed between 2.7.9 and 2.7.10. |
Looks like it started failing on #619 (which makes sense). |
Similar issue hitting slightly different code paths: import clr
clr.AddReference("System.Core")
import System.Linq
clr.ImportExtensions(System.Linq)
clr.ImportExtensions(System.Linq.Enumerable)
range(1,10).ElementAt(5) In this case the 2nd |
Looks like |
Hi. I'd like to get this issue resolved in some way. Is there a way for my company to sponsor this? Or could I get some input on how I can troubleshoot, find and fix this issue myself? |
I had looked at this a while back, you could deduplicate the methods in |
I think the concern about creating and populating a Another idea: what if methods are being resolved in in a way that those defined in types with |
I guess we'd need to add some API surface for this since the |
After giving it some thought today I think that replacing I have seen those lists and arrays created in several places and thought that they can be replaced with arrays allocated from a memory pool (for performance reasons). This will not be possible with a hash set. However, at this stage, correctness and usability trumps hypothetical performance gain. |
Hi. Any progress on this? I see that there is a PR in progress. |
Re-opening as the fix is only in ipy3... |
Running the following in .NET (Core):
leads to the following TypeError:
Reported by @Simon900225 on gitter.
The text was updated successfully, but these errors were encountered: