Repository navigation
Don't include new() constraint for generic params with struct constraint when warn=5 - #2
Closed
jtschuster wants to merge 1 commit into
Closed
jtschuster wants to merge 1 commit into
jtschuster wants to merge 1 commit into
Conversation
Author
|
cc @tlakollo |
Author
|
Here are the excess warnings the 7.0 linker produces on a hello world with the runtime as all copy assemblies (warnings that the 7.0 linker produces that the 6.0 sdk doesn't produce, Warnings removed by this change crossed out) I'm not sure why this change stops producing the MakeGenericMethod and MakeGenericType warnings, and it still needs testing to make sure it will warn when we want it to.
|
sbomer
approved these changes
Aug 19, 2022
sbomer
left a comment
Owner
There was a problem hiding this comment.
Thank you! This branch is fine for now - I am still not sure if we want to take any of these changes into main because they are hard to reason about, but this is good to get an idea for what kinds of quirks would be necessary. We should discuss options when @vitek-karas is available.
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.
In dotnet 6.0 we did not consider the struct constraint to imply the new() constraint, and this led to a few extra warnings in the dotnet 7 linker.
I'm not sure where the best place to put this change is, but here isolates the differences. Let me know if I should target dotnet/linker main or something else.