-
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
InvalidCastException when calling FirstOrDefault on a PythonList in .NET 6 #812
Comments
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? |
.NET 6 added an overload import clr
import System
clr.AddReference("System.Linq")
clr.ImportExtensions(System.Linq)
[0].FirstOrDefault[System.Int32](lambda x: x == 2) |
I'm back in the project where I had this issue after a years break. I have now downloaded the source of IronPython and managed to compile it so now I'm able to test a bit more. The thing is that I haven't manged to find where the The difference of the FuncCallInstruction between .NET 5 and .NET 8 looks like this |
Another error found both when using the implicit and the explicitly typed call This also stopped working from .NET 6 and forward. |
To reproduce:
Fails with:
Works fine on .NET 5.0, fails on .NET 6.0. It looks like the
T
ofIEnumeratorOfTWrapper<T>
isPythonFunction
instead ofSystem.Object
that we get on .NET 5.0.Reported by @Simon900225 on gitter.
The text was updated successfully, but these errors were encountered: