-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fixed VS crash during implicit conversion of null object in nullable walker #45974
Conversation
Can you please use more descriptive titles for PRs in the future? |
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.
😷
Apologies, forgot to change the title from when it was a draft. |
@@ -5537,7 +5537,7 @@ private Conversion GenerateConversionForConditionalOperator(BoundExpression sour | |||
private static Conversion GenerateConversion(Conversions conversions, BoundExpression sourceExpression, TypeSymbol sourceType, TypeSymbol destinationType, bool fromExplicitCast, bool extensionMethodThisArgument) | |||
{ | |||
HashSet<DiagnosticInfo> useSiteDiagnostics = null; | |||
bool useExpression = UseExpressionForConversion(sourceExpression); | |||
bool useExpression = (sourceType is null) ? true : UseExpressionForConversion(sourceExpression); |
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.
Consider writing as sourceType is null || UseExpressionForConversion(sourceExpression)
.
}; | ||
} | ||
}"; | ||
var comp = CreateCompilation(new[] { source }, parseOptions: TestOptions.Regular8, options: WithNonNullTypesTrue(TestOptions.ReleaseModule)); |
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.
Can be simplified to var comp = CreateCompilation(source);
@@ -4780,6 +4780,37 @@ void F(System.Action<System.Object?, System.Action<System.Object!, System.Object | |||
}); | |||
} | |||
|
|||
[Fact] | |||
[WorkItem(45862, "https://github.com/dotnet/roslyn/issues/45862")] | |||
public void Issue_45862() |
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.
Consider moving to NullableReferenceTypesTests.cs.
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.
Consider giving the test a descriptive name, perhaps "SwitchExpressionNoType".
In reply to: 455193504 [](ancestors = 455193504)
* upstream/master: (86 commits) Better client / server logging (dotnet#46079) Fix OptProf config Update src/VisualStudio/LiveShare/Impl/AbstractGoToDefinitionWithFindUsagesServiceHandler.cs Do not execute RemoveUnnecessaryInlineSuppressions on generated code Update dependencies from https://github.com/dotnet/arcade build 20200715.6 (dotnet#46086) Use ISpanMapper before sending cross file results to LSP Add additional module initializers tests from review (dotnet#46020) Fix type in OptProf configuration bump to 500 Fixed VS crash during implicit conversion of null object in nullable walker (dotnet#45974) Rename variable Fix KeyNotFound exception in RemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer Check modifiers on record positional members (dotnet#45898) Fix typos and link in Source Generators cookbook (dotnet#44372) Remove reference to non-existing VisualStudioInteractiveComponents.vsix from deployment VSIX. (dotnet#45979) Address feedback + fix tests Update dependencies from https://github.com/dotnet/roslyn build 20200711.1 (dotnet#45932) Make MetadataTypeName non-copyable Fix usage of GetService extension Consolidate service provider extensions ...
…to function-pointer-type-lookup * upstream/features/function-pointers: (86 commits) Better client / server logging (dotnet#46079) Fix OptProf config Update src/VisualStudio/LiveShare/Impl/AbstractGoToDefinitionWithFindUsagesServiceHandler.cs Do not execute RemoveUnnecessaryInlineSuppressions on generated code Update dependencies from https://github.com/dotnet/arcade build 20200715.6 (dotnet#46086) Use ISpanMapper before sending cross file results to LSP Add additional module initializers tests from review (dotnet#46020) Fix type in OptProf configuration bump to 500 Fixed VS crash during implicit conversion of null object in nullable walker (dotnet#45974) Rename variable Fix KeyNotFound exception in RemoveUnnecessaryInlineSuppressionsDiagnosticAnalyzer Check modifiers on record positional members (dotnet#45898) Fix typos and link in Source Generators cookbook (dotnet#44372) Remove reference to non-existing VisualStudioInteractiveComponents.vsix from deployment VSIX. (dotnet#45979) Address feedback + fix tests Update dependencies from https://github.com/dotnet/roslyn build 20200711.1 (dotnet#45932) Make MetadataTypeName non-copyable Fix usage of GetService extension Consolidate service provider extensions ...
Fixed VS crash during implicit conversion due to null object. Documented in issue #45862.
Changes: