Skip to content
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

[RFC FS-1079] Make .Is* discriminated union properties visible from F# #11394

Closed
wants to merge 9 commits into from

Conversation

chkn
Copy link
Contributor

@chkn chkn commented Apr 9, 2021

This implements RFC FS-1079 - Make .Is* discriminated union properties visible from F#.

I'd love feedback on a couple details:

  1. I added the union augmentation stuff into AugmentWithHashCompare so I could re-use the helper functions, and because the code is similar to what was already there. Is that a good place, and if so, should we rename that module because it no longer deals just with HashCompare?

  2. I'm not super proud of the fix to make the properties visible in a namespace rec context (470eb3d). It works, but maybe there is a nicer way to do it

Thanks!

@chkn
Copy link
Contributor Author

chkn commented Apr 9, 2021

FSC : error FS2014: A problem occurred writing the binary 'D:\a\1\s\artifacts\obj\FSharp.Core\Release\netstandard2.0\FSharp.Core.dll': Error in pass2 for type Microsoft.FSharp.Core.FSharpOption`1, error: duplicate entry 'get_IsNone' in method table [D:\a\1\s\src\fsharp\FSharp.Core\FSharp.Core.fsproj]

Hmm.. I think the proper fix here is to look for [<DefaultAugmentation(false)>] and not generate the properties in that case?

@smoothdeveloper
Copy link
Contributor

if so, should we rename that module because it no longer deals just with HashCompare?

Looking at the history, and given that those refactorings have a risk to break open PR / are, at times, handled by @dsyme or others in the team when they find the time is opportune, I'd say it is safer to not do the change in this PR.

I agree that something like TypeAugmentations.fs or similar would make sense, in the meantime, putting a comment about that realisation at the top of the file won't break anything and will bring it to the attention.

Putting up a separate PR with the refactoring may also get merged if it is the right time.

@auduchinok
Copy link
Member

Should this change be a language feature and be in the preview version first?

@cartermp
Copy link
Contributor

@auduchinok Yes, this will require a langversion guard before merging.

@smoothdeveloper
Copy link
Contributor

@chkn / @cartermp could you setup the discussion thread for the RFC?

@chkn, this PR is good place to discuss the implementation details but we need the space to discuss how the RFC will alter the language (@NinoFloris brought something to slack that is worth discussing).

I myself would prefer the feature to be guarded by an attribute (to enable it on case by case basis to F# callers), if you like that too, you can check my PR which introduces an attribute and carries the information in the type checker: #11368

We can discuss more the RFC itself once we have the discussion thread setup.

Thanks!

smoothdeveloper added a commit to smoothdeveloper/FSharpLangDesign that referenced this pull request Apr 19, 2021
@chkn
Copy link
Contributor Author

chkn commented Apr 19, 2021

@smoothdeveloper Thanks for tracking down that discussion thread!

I myself would prefer the feature to be guarded by an attribute (to enable it on case by case basis to F# callers)

My feeling is that we are already paying the metadata price for these members in IL, so we should be able to access them. You can already do [<DefaultAugmentation(false)>] to exclude those helpers entirely, and this PR honors that attribute.

putting a comment about that realisation at the top of the file won't break anything and will bring it to the attention.

Great idea, will add this.

Yes, this will require a langversion guard before merging.

I can add that as well.

@smoothdeveloper
Copy link
Contributor

My feeling is that we are already paying the metadata price for these members in IL, so we should be able to access them.

could you clarify what you mean by paying the metadata price?

To me, making them accessible at cost of an explicit attribute (opt-in) seems like a fair question to evaluate, but if the consensus is that it should just be there and that the original design choice to hide those members needs to be changed, so be it.

There was a conscious choice to hide those early in the language, changing it may affect the idioms significantly.

You can already do [<DefaultAugmentation(false)>] to exclude those helpers entirely, and this PR honors that attribute.

Thanks for this important precision that I overlooked, although I assume it gets rid of all which makes a DU a DU in terms of structural equality.

@@ -683,6 +683,32 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP
| SpecialFSharpOptionHelpers
| SpecialFSharpListHelpers ->

let baseTesterMeths, baseTesterProps =
if cenv.g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible then [], []
Copy link
Contributor Author

@chkn chkn Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea how to get langVersion here? (cenv is not defined here)

Copy link
Contributor

@dsyme dsyme Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to pass in a TcGlobals (g) instead of an ILGlobals

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't think this is possible because TcGlobals is defined later in the file ordering, however adding langVersion to ILGlobals doesn't seem too invasive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't think this is possible because TcGlobals is defined later in the file ordering, however adding langVersion to ILGlobals doesn't seem too invasive.

I believe you can move EraseUnions.fs later. It is really part of IlxGen.fs and can be placed right near there if necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a quick look at this approach, but it seems that TcGlobals depends on EraseUnions, at least in this one spot: https://github.com/dotnet/fsharp/blob/main/src/fsharp/TcGlobals.fs#L1660.

Perhaps it could be refactored, but I do think the patch to add langVersion to ILGlobals is fairly tidy (6885b0b), and may come in handy in the future. Any specific objections to that approach?

vzarytovskii
vzarytovskii previously approved these changes Jun 29, 2021
Copy link
Member

@vzarytovskii vzarytovskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good, thanks!

src/fsharp/TcGlobals.fs Outdated Show resolved Hide resolved
[<EntryPoint>]
let main _ =
let foo = Foo.Foo "hi"
printfn "IsFoo: %b / IsBar: %b" foo.IsFoo foo.IsBar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have tests

  1. that these are present in autocomplete lists
  2. what the results of "go to definition" on these is
  3. what happens when you try to rename this symbol (I guess it shouldn't be allowed)

I suspect (1) and (2) will be ok but (3) will not be - though I think we don't mind that much what happens with (3)

Ideally (1) and (2) should have automated tests

Copy link
Contributor

@dsyme dsyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have tests

that these are present in autocomplete lists
what the results of "go to definition" on these is
what happens when you try to rename this symbol (I guess it shouldn't be allowed)
I suspect (1) and (2) will be ok but (3) will not be - though I think we don't mind that much what happens with (3)

Ideally (1) and (2) should have automated tests

@dsyme
Copy link
Contributor

dsyme commented Jun 29, 2021

I'd like to see more testing of the language as well please, e.g.

  • namespace rec where the Is properties are used before the definition
  • test the quotation of an Is property
  • test generic types
  • test an SRTP constraint using an Is property

@vzarytovskii
Copy link
Member

vzarytovskii commented Jun 29, 2021

@chkn I've added some sample tests for rec namespace, SRTP, and fixed the issue with invoking the entry point in the testing framework.
Let me know if you'll need any help with it.

@@ -2443,7 +2574,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (env
// The rest should have been removed by splitting, they belong to "core" (they are "shape" of type, not implementation)
| _ -> error(Error(FSComp.SR.tcDeclarationElementNotPermittedInAugmentation(), mem.Range))))


let extraBindings = Dictionary(HashIdentity.Reference)
Copy link
Contributor

@dsyme dsyme Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused why the dictionary and two-phase approach is needed. Can't we make the PublishValueDefnMaybeInclCompilerGenerated calls in the first phase (the part with Some tycon when declKind = DeclKind.ModuleOrMemberBinding), and the AugmentWithHashCompare.MakeBindingsForUnionAugmentation in the second phase (the part that comes after MutRecBindingChecking.TcMutRecDefns_Phase2_Bindings)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, what you have is not wrong, and I can see that in order to do the second part you need to have the vals available from th first part anyway. I guess ideally they would be stored in the MutRecShape. However what you have is ok, maybe put a comment in like this:

/// In the first phase of establishing the type definitions we create and publish the values for the `Is*` members. For convencience we also create the associated bindings. The bindings aren't actually needed until the second phase, after `MutRecBindingChecking.TcMutRecDefns_Phase2_Bindings`, so we store them away in a dictionary until they are needed.

Also, the dictionary should really be indexed by stamp (tycon.Stamp). What is here is not wrong, it's just a little unusual in the compiler codebase to use object reference identity of Tycon/Entity as a key in a dictionary. Not a big deal but might be best to adjust it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as I recall, the tradeoff I was considering was stashing the vals away (e.g. in TyconAugmentation), but that would mean adding an extra pointer to every type that's only needed for unions. Given how many non-union types you might find in a compilation, that could add up to a lot of wasted memory.

I agree the dictionary isn't the most elegant solution and I'm open to other ideas. For now, I added the comment you suggested and modified the dictionary to use tycon.Stamp

@chkn
Copy link
Contributor Author

chkn commented Jul 5, 2021

@vzarytovskii Thanks! I also added your fix to the test runner in another spot, but it looks like a couple tests are still failing..not sure if it's related to this PR.

@vzarytovskii
Copy link
Member

vzarytovskii commented Jul 12, 2021

@chkn
The following are failing FSharpQA tests (which look related?):

+++ Conformance\BasicTypeAndModuleDefinitions\UnionTypes (E_Overload_Equals.fs) +++
...
*** The following necessary lines were never matched:
***	\(7,23-7,29\):.+error FS0438:.+Duplicate method\. The method 'Equals' has the same name and signature as another method in type 'DU'\.$

+++ Conformance\BasicTypeAndModuleDefinitions\UnionTypes (E_Overload_GetHashCode.fs) +++
...
*** The following necessary lines were never matched:
***	\(8,25-8,36\):.+error FS0438:.+Duplicate method\. The method 'GetHashCode' has the same name and signature as another method in type 'DU'\.$

+++ Conformance\ObjectOrientedTypeDefinitions\StructTypes (E_Overload_Equals.fs) +++
...
*** The following necessary lines were never matched:
***	\(8,17-8,23\):.+error FS0438:.+Duplicate method\. The method 'Equals' has the same name and signature as another method in type 'S3'\.$

+++ Conformance\ObjectOrientedTypeDefinitions\StructTypes (E_Overload_Equals.fsx) +++
...
*** The following necessary lines were never matched:
***	\(7,6-7,8\):.+error FS0438:.+Duplicate method\. The method 'Equals' has the same name and signature as another method in type 'S3'\.$

+++ Conformance\ObjectOrientedTypeDefinitions\StructTypes (E_Overload_GetHashCode.fs) +++
...
*** The following necessary lines were never matched:
***	\(8,17-8,28\):.+error FS0438:.+Duplicate method\. The method 'GetHashCode' has the same name and signature as another method in type 'S2'\.$

+++ Conformance\ObjectOrientedTypeDefinitions\StructTypes (E_Overload_GetHashCode.fsx) +++
...
*** The following necessary lines were never matched:
***	\(7,6-7,8\):.+error FS0438:.+Duplicate method\. The method 'GetHashCode' has the same name and signature as another method in type 'S2'\.$

I need to look closer to the other suite.

Copy link
Contributor Author

@chkn chkn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chkn
The following are failing FSharpQA tests (which look related?):

@vzarytovskii Thanks for digging into that. I think I was able to fix that by simply reverting b2b3c2c-- not sure why I wasn't seeing FS0023 before, but I am now even with that reverted. The only thing is now you get both errors:

error FS0438: Duplicate method. The method 'get_IsA' has the same name and signature as another method in type 'DU'.

error FS0438: Duplicate method. The method 'get_IsA' has the same name and signature as another method in type 'DU'.

error FS0023: The member 'IsA' can not be defined because the name 'IsA' clashes with the default augmentation of the union case 'A' in this type or module


Perhaps that's not so bad though?

@@ -2443,7 +2574,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (env
// The rest should have been removed by splitting, they belong to "core" (they are "shape" of type, not implementation)
| _ -> error(Error(FSComp.SR.tcDeclarationElementNotPermittedInAugmentation(), mem.Range))))


let extraBindings = Dictionary(HashIdentity.Reference)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as I recall, the tradeoff I was considering was stashing the vals away (e.g. in TyconAugmentation), but that would mean adding an extra pointer to every type that's only needed for unions. Given how many non-union types you might find in a compilation, that could add up to a lot of wasted memory.

I agree the dictionary isn't the most elegant solution and I'm open to other ideas. For now, I added the comment you suggested and modified the dictionary to use tycon.Stamp

@dsyme
Copy link
Contributor

dsyme commented Aug 9, 2021

I fixed the build here, will now review

@dsyme dsyme changed the title Implement RFC FS-1079 - Make .Is* discriminated union properties visible from F# [RFC FS-1079] Make .Is* discriminated union properties visible from F# Aug 9, 2021
@dsyme
Copy link
Contributor

dsyme commented Aug 9, 2021

I fixed the build here, will now review

Everything looks totally fine with this, I think we should go ahead and merge it into preview once it is green

@KevinRansom @vzarytovskii @TIHan @brettfo Please let me know if you have any concerns - I'm happy for this to be part of F# 6.0

dsyme
dsyme previously approved these changes Aug 9, 2021
@dsyme
Copy link
Contributor

dsyme commented Aug 9, 2021

@chkn An unexpected test failure - the surface area of FSharp.Core has changed, with these unexpectedly missing:

2021-08-09T16:37:19.9718691Z     Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean IsCons
2021-08-09T16:37:19.9719223Z     Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean IsEmpty
2021-08-09T16:37:19.9719739Z     Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean get_IsCons()
2021-08-09T16:37:19.9720282Z     Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean get_IsEmpty()
2021-08-09T16:37:19.9720757Z     Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean IsChoice1Of2
2021-08-09T16:37:19.9724712Z     Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean IsChoice2Of2
2021-08-09T16:37:19.9725311Z     Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean get_IsChoice1Of2()
2021-08-09T16:37:19.9725851Z     Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean get_IsChoice2Of2()
2021-08-09T16:37:19.9727996Z     Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean IsChoice1Of3
2021-08-09T16:37:19.9728527Z     Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean IsChoice2Of3
2021-08-09T16:37:19.9729316Z     Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean IsChoice3Of3
2021-08-09T16:37:19.9729784Z     Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean get_IsChoice1Of3()
2021-08-09T16:37:19.9730275Z     Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean get_IsChoice2Of3()
2021-08-09T16:37:19.9730749Z     Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean get_IsChoice3Of3()
2021-08-09T16:37:19.9731300Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice1Of4
2021-08-09T16:37:19.9731869Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice2Of4
2021-08-09T16:37:19.9732407Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice3Of4
2021-08-09T16:37:19.9732965Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice4Of4
2021-08-09T16:37:19.9733529Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice1Of4()
2021-08-09T16:37:19.9734069Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice2Of4()
2021-08-09T16:37:19.9737009Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice3Of4()
2021-08-09T16:37:19.9737597Z     Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice4Of4()
2021-08-09T16:37:19.9738058Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5
2021-08-09T16:37:19.9738534Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5
2021-08-09T16:37:19.9739017Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5
2021-08-09T16:37:19.9739474Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5
2021-08-09T16:37:19.9739943Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5
2021-08-09T16:37:19.9740405Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5()
2021-08-09T16:37:19.9740895Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5()
2021-08-09T16:37:19.9741386Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5()
2021-08-09T16:37:19.9741859Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5()
2021-08-09T16:37:19.9742344Z     Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5()
2021-08-09T16:37:19.9742813Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6
2021-08-09T16:37:19.9743296Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6
2021-08-09T16:37:19.9743775Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6
2021-08-09T16:37:19.9744241Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6
2021-08-09T16:37:19.9744718Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6
2021-08-09T16:37:19.9745179Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6
2021-08-09T16:37:19.9745673Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6()
2021-08-09T16:37:19.9746240Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6()
2021-08-09T16:37:19.9746773Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6()
2021-08-09T16:37:19.9747319Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6()
2021-08-09T16:37:19.9747969Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6()
2021-08-09T16:37:19.9748520Z     Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6()
2021-08-09T16:37:19.9749065Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7
2021-08-09T16:37:19.9749588Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7
2021-08-09T16:37:19.9750127Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7
2021-08-09T16:37:19.9750738Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7
2021-08-09T16:37:19.9751260Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7
2021-08-09T16:37:19.9751797Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7
2021-08-09T16:37:19.9752321Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7
2021-08-09T16:37:19.9752872Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7()
2021-08-09T16:37:19.9753426Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7()
2021-08-09T16:37:19.9753969Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7()
2021-08-09T16:37:19.9754529Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7()
2021-08-09T16:37:19.9755070Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7()
2021-08-09T16:37:19.9755627Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7()
2021-08-09T16:37:19.9756183Z     Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7()
2021-08-09T16:37:19.9756691Z     Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean IsError
2021-08-09T16:37:19.9757178Z     Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean IsOk
2021-08-09T16:37:19.9757659Z     Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean get_IsError()
2021-08-09T16:37:19.9758159Z     Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean get_IsOk()
2021-08-09T16:37:19.9758653Z     Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueNone
2021-08-09T16:37:19.9759130Z     Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueSome
2021-08-09T16:37:19.9759627Z     Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueNone()
2021-08-09T16:37:19.9760123Z     Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueSome()

@vzarytovskii
Copy link
Member

vzarytovskii commented Aug 11, 2022

I've merged it with main.
This should be passing now.

@dsyme give it another go when you'll have time.

@vzarytovskii
Copy link
Member

Ok, some unrelated test failures which i probably have broken when merging stuff. Will fix it once back from vacation next week.

@vzarytovskii
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@vzarytovskii
Copy link
Member

vzarytovskii commented Aug 15, 2022

PEVerify is failing on one of the dlls (invalid IL for generated methods?):

Error running command 'D:\a_work\1\s\tests\FSharp.Test.Utilities....\artifacts\bin\PEVerify\Release\net472\PEVerify.exe' with args 'test--optimize-lib.dll /nologo' in directory 'D:\a_work\1\s\tests\fsharp\core\members\basics'.
---- stdout below ---
[D:\a_work\1\s\tests\fsharp\core\members\basics\test--optimize-lib.dll : Global+button::get_IsButtpon][mdToken=0x6000061][offset 0x00000002] Stack must contain only the return value.
[D:\a_work\1\s\tests\fsharp\core\members\basics\test--optimize-lib.dll : Global+callconv::get_IsAA][mdToken=0x600008e][offset 0x00000002] Stack must contain only the return value.

---- stderr below ---
. ERRORLEVEL 2

Not sure what to do with it.

@dsyme
Copy link
Contributor

dsyme commented Aug 15, 2022

Some secondary thoughts on this

I'll add these to the discussion for the RFC

@edgarfgp
Copy link
Contributor

edgarfgp commented Aug 15, 2022

Some secondary thoughts on this

I can imagine this been problematic if for example if we have a

[<RequireQualifiedAccess>]
type X =
 | A
 | a

where we would have IsA and Isa  

@dsyme
Copy link
Contributor

dsyme commented Aug 16, 2022

I can imagine this been problematic if for example if we have ....

Yes. Though equally the feature is at least "honest" as we do codegen these properties and they can be used from C#....

@vzarytovskii
Copy link
Member

Wondering how is it interacting with backticked DU cases.

@dsyme
Copy link
Contributor

dsyme commented Aug 17, 2022

Wondering how is it interacting with backticked DU cases.

Certainly should be under test. I'd imagine it's just x.``IsA thing with spaces``

@vzarytovskii vzarytovskii dismissed stale reviews from dsyme and themself via de5dd73 October 5, 2022 16:11
@vzarytovskii vzarytovskii marked this pull request as draft December 8, 2022 12:12
@KevinRansom
Copy link
Member

@chkn, do you still want to pursue this PR, it has been almost a year without any action? it seems to need some conflict resolution, and perhaps tests.

@chkn
Copy link
Contributor Author

chkn commented May 20, 2023

@KevinRansom Hmm just reading back through the comments. Seems like we need to:

I'll try to find some time to get that done; it would be nice to finally land this :p

Note that I've been using this branch locally for ages to build a project without any issue.

@chkn
Copy link
Contributor Author

chkn commented May 24, 2023

I can't run the tests locally- they are crashing. Does anyone have any tips?

The active test run was aborted. Reason: Test host process crashed : Stack overflow.
   at FSharp.Compiler.TypedTreeOps.|CompiledForEachExpr|_|(TcGlobals, Expr)
   at FSharp.Compiler.TypedTreeOps.|CompiledInt32RangeForEachExpr|_|(TcGlobals, Expr)
   at FSharp.Compiler.TypedTreeOps.DetectAndOptimizeForEachExpression(TcGlobals, OptimizeForExpressionOptions, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLValueExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLValueExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLValueArgs(QuotationGenerationScope, QuotationTranslationEnv, Microsoft.FSharp.Collections.FSharpList`1<Expr>)
   at FSharp.Compiler.QuotationTranslator.ConvObjectModelCallCore(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, Boolean, Boolean, Boolean, NamedTypeData, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, TypeData, System.String, Microsoft.FSharp.Collections.FSharpList`1<TType>, Int32, Microsoft.FSharp.Collections.FSharpList`1<Expr>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvObjectModelCall(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, Boolean, Boolean, Boolean, NamedTypeData, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, TypeData, System.String, Microsoft.FSharp.Collections.FSharpList`1<TType>, Int32, Microsoft.FSharp.Collections.FSharpList`1<Expr>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator+GetWitnessArgs@252.Invoke(Microsoft.FSharp.Core.FSharpChoice`2<TraitConstraintInfo,Expr>)
   at Microsoft.FSharp.Primitives.Basics.List.map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Microsoft.FSharp.Collections.ListModule.Map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator+ConvExprs@921.Invoke(Expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Microsoft.FSharp.Primitives.Basics.List.map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Microsoft.FSharp.Collections.ListModule.Map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at FSharp.Compiler.QuotationTranslator.ConvModuleValueAppCore(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, ValRef, Microsoft.FSharp.Collections.FSharpList`1<TType>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvModuleValueApp(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, ValRef, Microsoft.FSharp.Collections.FSharpList`1<TType>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLetBind(QuotationGenerationScope, QuotationTranslationEnv, Binding)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.Quotatio
Results File: /Users/alex/OpenSource/fsharp/artifacts/TestResults/Debug/FSharp.Compiler.ComponentTests_net7.0.xml

The active Test Run was aborted because the host process exited unexpectedly. Please inspect the call stack above, if available, to get more information about where the exception originated from.
The test running when the crash occurred: 
FSharp.Compiler.ComponentTests.EmittedIL.QueryExpressionStepping.Linq101Grouping01_fs

This test may, or may not be the source of the crash.

@vzarytovskii
Copy link
Member

I can't run the tests locally- they are crashing. Does anyone have any tips?

The active test run was aborted. Reason: Test host process crashed : Stack overflow.
   at FSharp.Compiler.TypedTreeOps.|CompiledForEachExpr|_|(TcGlobals, Expr)
   at FSharp.Compiler.TypedTreeOps.|CompiledInt32RangeForEachExpr|_|(TcGlobals, Expr)
   at FSharp.Compiler.TypedTreeOps.DetectAndOptimizeForEachExpression(TcGlobals, OptimizeForExpressionOptions, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLValueExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLValueExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLValueArgs(QuotationGenerationScope, QuotationTranslationEnv, Microsoft.FSharp.Collections.FSharpList`1<Expr>)
   at FSharp.Compiler.QuotationTranslator.ConvObjectModelCallCore(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, Boolean, Boolean, Boolean, NamedTypeData, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, TypeData, System.String, Microsoft.FSharp.Collections.FSharpList`1<TType>, Int32, Microsoft.FSharp.Collections.FSharpList`1<Expr>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvObjectModelCall(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, Boolean, Boolean, Boolean, NamedTypeData, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, Microsoft.FSharp.Collections.FSharpList`1<TypeData>, TypeData, System.String, Microsoft.FSharp.Collections.FSharpList`1<TType>, Int32, Microsoft.FSharp.Collections.FSharpList`1<Expr>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator+GetWitnessArgs@252.Invoke(Microsoft.FSharp.Core.FSharpChoice`2<TraitConstraintInfo,Expr>)
   at Microsoft.FSharp.Primitives.Basics.List.map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Microsoft.FSharp.Collections.ListModule.Map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator+ConvExprs@921.Invoke(Expr)
   at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Microsoft.FSharp.Primitives.Basics.List.map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at Microsoft.FSharp.Collections.ListModule.Map[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>, Microsoft.FSharp.Collections.FSharpList`1<System.__Canon>)
   at FSharp.Compiler.QuotationTranslator.ConvModuleValueAppCore(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, ValRef, Microsoft.FSharp.Collections.FSharpList`1<TType>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvModuleValueApp(QuotationGenerationScope, QuotationTranslationEnv, FSharp.Compiler.Text.Range, ValRef, Microsoft.FSharp.Collections.FSharpList`1<TType>, Microsoft.FSharp.Collections.FSharpList`1<ExprData>, Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<Expr>>)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvLetBind(QuotationGenerationScope, QuotationTranslationEnv, Binding)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExprCore(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.QuotationTranslator.ConvExpr(QuotationGenerationScope, QuotationTranslationEnv, Expr)
   at FSharp.Compiler.Quotatio
Results File: /Users/alex/OpenSource/fsharp/artifacts/TestResults/Debug/FSharp.Compiler.ComponentTests_net7.0.xml

The active Test Run was aborted because the host process exited unexpectedly. Please inspect the call stack above, if available, to get more information about where the exception originated from.
The test running when the crash occurred: 
FSharp.Compiler.ComponentTests.EmittedIL.QueryExpressionStepping.Linq101Grouping01_fs

This test may, or may not be the source of the crash.

You should probably run them in Release mode. We run Release in CI. To fix it in Debug, probably worth looking at what's crashing and use StackGuard.

@kerams
Copy link
Contributor

kerams commented Jul 10, 2023

Pingerino. Would be a shame not to have this in F# 8.

@kerams
Copy link
Contributor

kerams commented Jul 11, 2023

@chkn, I've brought this up-to-date locally and added a backtick test. If you give me write permissions to your fork, I can push the changes here and see what happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

9 participants