-
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
Subtraction of two chars, new conversions, and fixes for dynamic operator invocations and QuotationToExpression #11681
Conversation
RIP the CI |
Yep, it seems CI is having a bad day today :( |
Failing tests unrelated? |
See my comment here: fsharp/fslang-suggestions#1030 (comment) |
Note that some witness-passing code will need to be updated, check SubtractionDynamic and look for test cases related to witness passing |
There is currently no test cases related to SubtractionDynamic. Are you referring to #6805 which is still open? |
Seach for this test:
and add a case for subtraction of chars It exercises SubtractionDynamic under the hood |
FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation <@ 'a' + '\001' @>
|> printfn "%O" fails with
. Looks like a fix will also be required. |
Same for FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation <@ 1uy + 1uy @> . Should fixing these be considered in-scope for this PR? |
I'll handle them in this PR. |
Ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a detailed scan and this looks good now. I will do one more detailed line by line review soon and then we can pull.
We will wait at least until dev17.0 --> main integration is done.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/@Happypig375 --- Thanks for this contribution , however, it seems to have remained untouched in quite a while. Do you have plans to return to it? or can it be closed? Thanks Kevin |
@KevinRansom This PR has been waiting on the F# team for ages and you are telling me that it's my fault for leaving this untouched? |
I will only touch this PR again if there is a guarantee of merging. |
I will take care of merging |
Cool I'll do a review, thanks |
@KevinRansom @dsyme this looks fine to me, I'm okay with merging it. Wdyt? |
The year-long journey is finally over! |
@Happypig375 This is a truly vast amount of work on your part. It's really remarkable how much you have systematically tested this. The PR adds complexity - which is why it took so very long to merge it - but the test suite captures why this is needed. Some things that would have made it quicker
|
It indeed looks like tremendous work on test coverage. I wonder if the tests under TestExpr wouldn't benefit from something similar as what was done for surface area, and also extracting the F# code input into files that can be edited with F# editor. It must have been really hard to udpate the test and make it pass, to consider when adding such test will be required again. |
* ValRepInfoForDisplay added for improved quick info for functions defined in expressions * Update * Update QuickInfoTests.fs * Update QuickInfoTests.fs * Update * add identifier analysis script (#13486) * add identifier analysis script * add identifier analysis script * Update fantomas alpha 11 (#13481) * Allow lower-case DU cases when RequireQualifiedAccess is specified (#13432) * Allow lower-case DU cases when RequireQualifiedAccess is specified * Fix PR suggestions and Add more testing * Protect feature under preview version * Add a NotUpperCaseConstructorWithoutRQA warning to be raised in lang version preview * Fix formatting * regularize some names (#13489) * normalize some names * format code * fix build * Subtraction of two chars, new conversions, and fixes for dynamic operator invocations and QuotationToExpression (#11681) Co-authored-by: Vlad Zarytovskii <[email protected]> Co-authored-by: Don Syme <[email protected]> * Mark backing fields as CompilerGenerated (fixes serialization of fields in FSI multiemit) (#13494) Co-authored-by: Don Syme <[email protected]> Co-authored-by: Peter Semkin <[email protected]> Co-authored-by: Don Syme <[email protected]> Co-authored-by: Florian Verdonck <[email protected]> Co-authored-by: Petr Semkin <[email protected]> Co-authored-by: Edgar Gonzalez <[email protected]> Co-authored-by: Hadrian Tang <[email protected]> Co-authored-by: Vlad Zarytovskii <[email protected]> Co-authored-by: Kevin Ransom (msft) <[email protected]>
fsharp/fslang-suggestions#1030
fsharp/fslang-suggestions#1040
Fixes for
LanguagePrimitives.ExplicitDynamic
op_Implicit
System.NotSupportedException: Dynamic invocation of op_Addition involving coercions is not supported.
Now it invokes the
op_Implicit
instead.op_Explicit
System.Reflection.AmbiguousMatchException: Ambiguous match found.
because the old implementation did a direct lookup ofop_Explicit
with parameter types, but reflection does not support looking up by overloaded return types directly.Now it invokes the
B -> int
overload ofB.op_Explicit
.Fix for
LanguagePrimitives.InequalityDynamic
OpEqualityInfo
was used instead ofOpInequalityInfo
Optimizations for type-to-same-type conversions
byte 1uy
used to emit aconv.u1
instruction, now it is a no-op because the types are the same, and just returning the input is fine.Fix for dynamic invocations of checked operators
LanguagePrimitives.ExplicitDynamic
,LanguagePrimitives.CheckedExplicitDynamic
is added which performs dynamic checked operationsAnd various fixes for
FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.QuotationToExpression
<@ 1y + 1y @>
(Used to throwSystem.InvalidOperationException: The binary operator Add is not defined for the types 'System.SByte' and 'System.SByte'.
)<@ [] < [] @>
(Used to throwSystem.InvalidOperationException: The binary operator LessThan is not defined for the types 'Microsoft.FSharp.Collections.FSharpList
1[System.IComparable]' and 'Microsoft.FSharp.Collections.FSharpList1[System.IComparable]'.
)<@ [|1|] = [|1|] @>
(Used to translate to physical equality instead of structural equality like outside of quotations)<@ decimal LanguagePrimitives.GenericOne<nativeint> @>
(Used to throwSystem.InvalidOperationException: No coercion operator is defined between types 'System.IntPtr' and 'System.Decimal'.
)