-
Notifications
You must be signed in to change notification settings - Fork 789
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
Regression with quotations of List.sum on non-primitive type #10364
Comments
The relevant fix is here: c4b28a1 |
@dsyme at most we're looking at a servicing release for .NET 5 or 16.8. Is that necessary, or would you be fine just having this as a known issue and letting the fix flow into 16.9 and the patch to .NET 5 that will go with it? Both are set to go out around February. |
I presume the workaround will be sufficient for customers, I'll let you make the call, and how to document it as a known issue so it's discoverable by a search. That is, assuming the problem actually gets reported in practice. It feels like it will but I may be wrong |
Sounds goood, i'll tag it as 16.9. |
This was fixed in #9510 |
Description
When using
--langversion:5.0
(the default in F# 5.0), taking the quotation of a use ofList.sum
on a non-primitive type causes a compilation exception related to generating the witness for theZero
property.This will apply to a quotation of any code calling
let inline
SRTP code which uses a constraint on aget_Foo
property method or any SRTP constraint that takes no argumentsmember M : unit -> ...
Repro
gives
Another repro is
Workarounds
One workaround is to use
--langversion:4.7
Another possible workaround is to define a non-inlined helper function outside the quotation, e.g. as follows. If necessary label the function as
ReflectedDefinition
. This may not work if the quotation is being processed requires access to the full quotation tree.Severity
This bug has not yet been seen in actual user code, but was instead noticed as part of #9510, which applies witness generation to a much broader range of code (all code going through Fable).
However it's likely to affect some user code.
Since a workaround is to use
--langversion:4.7
it is likely that the actual severity in practice will be low.The text was updated successfully, but these errors were encountered: