This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
Convert ValueNode to record - #2419
Merged
vitek-karas merged 4 commits intoDec 3, 2021
Merged
Conversation
sbomer
approved these changes
Dec 3, 2021
marek-safar
reviewed
Dec 6, 2021
| class SystemTypeValue : LeafValueNode | ||
| record SystemTypeValue : LeafValueNode | ||
| { | ||
| public SystemTypeValue (TypeDefinition typeRepresented) |
Contributor
There was a problem hiding this comment.
It's strange to see such ctors in records, why not use records syntax?
Member
Author
There was a problem hiding this comment.
I'm still learning records. Which record syntax did you have in mind?
Using init only properties - VS even suggest adding a .ctor.
Using function-like positional parameters - This is really tricky with properties on base type - it seems the base type would have to make the properties mandatory....
Contributor
There was a problem hiding this comment.
Which record syntax did you have in mind?
record SystemTypeValue (TypeDefinition TypeRepresented) : LeafValueNode
{
}you should be able to delete the ctor after this
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
This is in preparation to merging the value type system with the analyzer and the `SingleValue` type. Removes the Kind enum and uses type checks instead (there are not that many places actually since we already used type checks in lot of places). Cleans up some of the value .ctors and properties. Remove Equals/GetHashCode implementation where possible (leave it up to record). Commit migrated from dotnet/linker@a114ab5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is in preparation to merging the value type system with the analyzer and the
SingleValuetype.Removes the Kind enum and uses type checks instead (there are not that many places actually since we already used type checks in lot of places).
Cleans up some of the value .ctors and properties.
Remove Equals/GetHashCode implementation where possible (leave it up to record).