-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Adjust type substitution for oblivious type argument in not-annotated type parameter #48694
Conversation
{ | ||
if (!typeSymbol.IsTypeParameterDisallowingAnnotationInCSharp8()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsTypeParameterDisallowingAnnotationInCSharp8 [](start = 32, length = 45)
Where else do we use this helper and whether we still need to use it, given that we now allow annotations on type parameters like that? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless it's crucial for this discussion or PR, I'd rather not branch out to that question. There are many other places that use this method at the moment.
In reply to: 506777623 [](ancestors = 506777623)
Is this a breaking change for C# 8? #ByDesign Refers to: src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs:9756 in f8e19e3. [](commit_id = f8e19e3f042f5005efaa0d125dfac22e79d704ad, deletion_comment = False) |
Yes. It is a new nullability warning. In reply to: 710720527 [](ancestors = 710720527) Refers to: src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs:9756 in f8e19e3. [](commit_id = f8e19e3f042f5005efaa0d125dfac22e79d704ad, deletion_comment = False) |
This draft PR for proposal 2 reveals some annoying additional warnings. We're now leaning towards proposal 0 or proposal 1 (doc). Will open a new PR for one of these |
@cston @AlekseyTs @dotnet/roslyn-compiler This PR can be looked at. I've walked Chuck and Aleksey through the design change, but am happy to do the same for anyone interested. I've fixed two of the orthogonal issues (re-inferring user-defined conversions, analysis of |
cb1daa8
to
f941ea6
Compare
5ea623b
to
b1b73ee
Compare
Closing in favor of #49723 |
This PR changes type substitution from:
to:
Benefits:
IsTypeParameterDisallowingAnnotationInCSharp8
orIsValueType
for type substitution anymoreout T?
rather thanout T
#49131)Drawbacks:
using foreach
which needs further investigation (fixed in this PR, commit 90d4209)Note that iteration 1 just adds a test baseline (
TypeSubstitution
) to show the change.