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

Infinite loop when comparing a unit of measure abbreviation with another type #395

Open
mlaily opened this issue Mar 10, 2023 · 1 comment

Comments

@mlaily
Copy link
Contributor

mlaily commented Mar 10, 2023

Description

While working on FSharp.Data, I noticed that comparing a UoM abbreviation type with a IJsonDocument type causes an infinite recursion/loop.

Repro steps

On FSharp.Data, I triggered this with the JsonProvider and an inline schema containing an abbreviated UoM:

type InlineSchemas = JsonProvider<""" {"a": "typeof<int<m>>"} """, InferenceMode=InferenceMode.ValuesAndInlineSchemasOverrides>

image

Note the lack of full syntactic colorization, since the IDE is caught in the loop.

Known workarounds

Replacing m with metre works: no infinite loop.

EDIT: ah it seems I was just lucky to pick one that was not in the list!
After completing the list in this PR #394, metre is now considered as a FSharpTypeAbbreviation, and the equality check loops the same way as with m! :/

Related information

I tried updating the github commit of the SDK referenced by FSharp.Data, but the problem still exists.

I'm not sure how to fix it, but in case it helps, here are a few screenshots of the looping methods:

image

image

image

And back to square one:
image

@mlaily
Copy link
Contributor Author

mlaily commented Mar 11, 2023

I'd appreciate any pointer about how to fix that :)

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

No branches or pull requests

1 participant