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

struct tuples and struct anon records should be considered subtypes of System.ValueType #10006

Merged
merged 13 commits into from
Sep 6, 2020

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Aug 25, 2020

See #7618

  1. One part of the fix is the adjustment to the logic when enforcing a constraint that a type support a default constructor - adding cases for struct tuples and anonymous records

  2. Another part of the fix is to make sure System.ValueType appears on the inheritance chain of struct tuples and anonymous records

  3. The generic cases in Problematic differences in constraint handling for structs between C# and F# #7946 required addressing the issue of whether generic variables support default values or not, which had surprisingly not been addressed before.

All of these count as bug fixes within the context of F# 5.0 - bug #3 should really have been addressed years ago.

Testing for all these is added

@dsyme dsyme changed the title [WIP] tentative fix for 7618 - struct tuples and struct anon records should be considered subtypes of System.ValueType fix for 7618 - struct tuples and struct anon records should be considered subtypes of System.ValueType Sep 4, 2020
@dsyme
Copy link
Contributor Author

dsyme commented Sep 4, 2020

This is now ready (need to double check it is green)

@dsyme
Copy link
Contributor Author

dsyme commented Sep 4, 2020

Hmmm one failing test with a difference in a baseline, will look into it

@cartermp cartermp changed the title fix for 7618 - struct tuples and struct anon records should be considered subtypes of System.ValueType struct tuples and struct anon records should be considered subtypes of System.ValueType Sep 6, 2020
@cartermp cartermp merged commit b5d11e5 into dotnet:main Sep 6, 2020
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
…f System.ValueType (dotnet#10006)

* tentative fix for 7618

* further part of fix

* testing for various constraints

* testing for various constraints

* consider appropriately annotated type variables to have default constructors and default values

* simplify code

* add extra test case

* add back missing file

Co-authored-by: Phillip Carter <pcarter@fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants