Skip to content

Fix inference for same (but distinct) record types in seq CE #16040

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

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

abonie
Copy link
Member

@abonie abonie commented Sep 25, 2023

Fixes #14213

The issue was, that with implicit yield, we first don't know whether an expression will have type unit or some particular expected type, so we type check it without any additional constraints, but that leads to ignoring type annotation and in case of #14213 we infer wrong type.

My solution so far is check the same expression again if we concluded it is not unit, this time with a subtype constraint.

@abonie abonie force-pushed the fix-inf-seqce branch 3 times, most recently from 435507d to 1762044 Compare October 2, 2023 14:08
@abonie abonie force-pushed the fix-inf-seqce branch 2 times, most recently from 554cd5b to 2e257e1 Compare October 4, 2023 14:52
@abonie abonie changed the title [WIP] Fix inference for same (but distinct) record types in seq CE Fix inference for same (but distinct) record types in seq CE Oct 5, 2023
abonie added 3 commits October 5, 2023 15:02
Seems like it could be done better, right now there are two type
checking passes for same expression
This should be okay, because in both cases, the error message basically
says the same thing.
@abonie
Copy link
Member Author

abonie commented Oct 5, 2023

Weird that it failed CI after rebasing on main with errors related to deserialization

Fatal error. Internal CLR error. (0x80131506)
at System.Runtime.Serialization.SerializationGuard.<ThrowIfDeserializationInProgress>g__ThrowIfDeserializationInProgress|0_0(System.Runtime.Serialization.SerializationInfo, System.String, Int32 ByRef)

Will try to rerun

@abonie
Copy link
Member Author

abonie commented Oct 5, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@abonie abonie marked this pull request as ready for review October 5, 2023 15:37
@abonie abonie requested a review from a team as a code owner October 5, 2023 15:37
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.

Implicit yield and if-then when using records with similarly-named fields causes type inference error
4 participants