Adjust type substitution for oblivious type argument in not-annotated type parameter #48694
Adjust type substitution for oblivious type argument in not-annotated type parameter #48694jcouv wants to merge 7 commits intodotnet:masterfrom
Conversation
There was a problem hiding this comment.
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.
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:
IsTypeParameterDisallowingAnnotationInCSharp8orIsValueTypefor type substitution anymoreout T?rather thanout T#49131)Drawbacks:
using foreachwhich needs further investigation (fixed in this PR, commit 90d4209)Note that iteration 1 just adds a test baseline (
TypeSubstitution) to show the change.