-
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
Remove the nullable wrappers from the Workspaces layer #40030
Merged
jasonmalinowski
merged 7 commits into
dotnet:master
from
jasonmalinowski:remove-nullable-wrappers
Dec 4, 2019
Merged
Remove the nullable wrappers from the Workspaces layer #40030
jasonmalinowski
merged 7 commits into
dotnet:master
from
jasonmalinowski:remove-nullable-wrappers
Dec 4, 2019
Conversation
This file contains 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
jasonmalinowski
force-pushed
the
remove-nullable-wrappers
branch
from
November 27, 2019 01:57
d5102d1
to
fbed819
Compare
CyrusNajmabadi
approved these changes
Nov 27, 2019
jasonmalinowski
force-pushed
the
remove-nullable-wrappers
branch
2 times, most recently
from
November 27, 2019 22:11
8473c3a
to
d3e3d35
Compare
This was referenced Nov 28, 2019
jasonmalinowski
force-pushed
the
remove-nullable-wrappers
branch
6 times, most recently
from
December 3, 2019 18:17
bc605e2
to
3af5fa3
Compare
sharwell
reviewed
Dec 3, 2019
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
src/Workspaces/Core/Portable/Shared/Extensions/SyntaxGeneratorExtensions_CreateEqualsMethod.cs
Outdated
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
src/Workspaces/Core/Portable/Utilities/NullableHelpers/NullableExtensions.cs
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
src/Features/CSharp/Portable/Completion/CompletionProviders/ObjectCreationCompletionProvider.cs
Outdated
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
src/Features/CSharp/Portable/ExtractMethod/CSharpMethodExtractor.Analyzer.cs
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
...table/GenerateMember/GenerateParameterizedMember/CSharpGenerateParameterizedMemberService.cs
Outdated
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
src/Features/CSharp/Portable/SignatureHelp/TupleConstructionSignatureHelpProvider.cs
Show resolved
Hide resolved
sharwell
reviewed
Dec 3, 2019
src/Features/Core/Portable/GenerateType/AbstractGenerateTypeService.State.cs
Show resolved
Hide resolved
This was referenced Dec 3, 2019
ryzngard
reviewed
Dec 3, 2019
src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs
Show resolved
Hide resolved
sharwell
approved these changes
Dec 3, 2019
src/Workspaces/Core/Portable/Shared/Extensions/SemanticModelExtensions.cs
Show resolved
Hide resolved
src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs
Show resolved
Hide resolved
src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/LanguageServices/CSharpTypeInferenceService.TypeInferrer.cs
Show resolved
Hide resolved
jasonmalinowski
force-pushed
the
remove-nullable-wrappers
branch
from
December 3, 2019 20:46
f8eaf1c
to
14e6b00
Compare
…ted base Our constructed type symbol was holding onto an abstract type symbol; this allowed a constructed type to be created atop another constructed type, which would form a chain. That isn't really necessary, and doesn't match the usual mental models. This switches to holding onto a stronger type, and then updates the Construct methods to go back to the prior ConstructedFrom in order to avoid creating a chain.
… symbols This wasn't necessary when we had wrapped symbols, since it was the wrapper that had the annotation. Now that we are removing wrappers we need to implement it directly.
jasonmalinowski
force-pushed
the
remove-nullable-wrappers
branch
from
December 3, 2019 23:53
14e6b00
to
32592f0
Compare
The compiler merged support for top-level symbol nullability in dotnet#39498, so we can now delete our own wrappers that were performing the same thing. This is a mostly mechanical change. For places where we were calling LookupSymbols or ClassifyConversion, those places previously called .WithoutNullability() since the compiler API would have thrown if we gave it our wrappers, but the APIs had otherwise no way to pass top-leve nullability. That was an accepted oversight at the time, and the belief is passing in the full symbol will generally be more correct.
In the deepest of ironies, the extension methods we had to wrap top-level nullability was implicitly hiding a potential null reference. Removing the extension methods is now flagging this, so this fixes it up. The handling isn't ideal: if we don't have a Task<T> we won't necessarily wrap, but that's not something really worth going out of our way to support -- most code doesn't.
This clarifies why we are stripping the nullability, and replaces it with the "not null" instead of "oblivious" which generates to the same code but is a bit more correct if something else tried to operate on the type symbol.
…ctly We weren't ensuring the the tuple elements had top-level nullability if we inferred the pattern was itself using nullable.
jasonmalinowski
force-pushed
the
remove-nullable-wrappers
branch
from
December 4, 2019 00:01
32592f0
to
b3d36f1
Compare
ryzngard
approved these changes
Dec 4, 2019
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.
The compiler merged support for top-level symbol nullability in #39498, so we can now delete our own wrappers that were performing the same thing. This is a mostly mechanical change. Commit-by-commit might be slightly more helpful as the similar types of changes were grouped together.
Closes #39737
Fixes #36093
Fixes #39693 (or was fixed by compiler work, unsure)
Closes #36099
Fixes #38047