Repository navigation
Cleanup resulting from enabling nullables. - #372
Merged
Merged
Conversation
Replace Asserts that are now handled by nullable analysis. Add some more "#nullable enable" to quieten code analysis in VS. Rename a method in CodeBuilder because it referred to Cpp but is now used by C# as well.
|
|
||
| static void TransferShapeProperties(CompositionShape from, CompositionShape to) | ||
| { | ||
| void TransferProperty<T>(Func<CompositionShape, T> get, Action<CompositionShape, T> set) |
There was a problem hiding this comment.
TransferProperty [](start = 17, length = 16)
Curious about the changes in this file-- why was this method separated? The new methods appear identical other than what type T is allowed to be. #Resolved
Contributor
Author
There was a problem hiding this comment.
It's to allow T? into the type signature. As soon as you have a T?, you have to differentiate between value types and reference types, otherwise it's not clear to the compiler what the ? means. So I add the ?, and added a constraints for the class and struct versions.
You can't overload methods based on constraints, so it also required giving the methods distinct names.
In reply to: 508724228 [](ancestors = 508724228)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace Asserts that are now handled by nullable analysis.
Add some more "#nullable enable" to quieten code analysis in VS.
Rename a method in CodeBuilder because it referred to Cpp but is now used by C# as well.