Fix null warnings (#22615)

This commit is contained in:
Brennan 2020-06-06 09:33:25 -07:00 committed by GitHub
parent 8cc9ee14af
commit e657de4b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View File

@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 16
# Visual Studio Version 16
VisualStudioVersion = 16.0.0.0
MinimumVisualStudioVersion = 16.0.0.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Shared.Tests", "test\Shared.Tests\Microsoft.AspNetCore.Shared.Tests.csproj", "{06CD38EF-7733-4284-B3E4-825B6B63E1DD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThrowingLibrary", "test\testassets\ThrowingLibrary\ThrowingLibrary.csproj", "{4799E505-5F83-4AB3-B96D-EACEB3528854}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -15,6 +17,10 @@ Global
{06CD38EF-7733-4284-B3E4-825B6B63E1DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06CD38EF-7733-4284-B3E4-825B6B63E1DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06CD38EF-7733-4284-B3E4-825B6B63E1DD}.Release|Any CPU.Build.0 = Release|Any CPU
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,17 +1,18 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Text;
#nullable enable
namespace Microsoft.Extensions.StackTrace.Sources
{
internal class ParameterDisplayInfo
{
public string Name { get; set; }
public string? Name { get; set; }
public string Type { get; set; }
public string? Type { get; set; }
public string Prefix { get; set; }
public string? Prefix { get; set; }
public override string ToString()
{

View File

@ -1,7 +1,8 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics;
#nullable enable
namespace Microsoft.Extensions.StackTrace.Sources
{
@ -9,10 +10,10 @@ namespace Microsoft.Extensions.StackTrace.Sources
{
public int LineNumber { get; set; }
public string FilePath { get; set; }
public string? FilePath { get; set; }
public StackFrame StackFrame { get; set; }
public StackFrame? StackFrame { get; set; }
public MethodDisplayInfo MethodDisplayInfo { get; set; }
public MethodDisplayInfo? MethodDisplayInfo { get; set; }
}
}

View File

@ -132,7 +132,7 @@ namespace Microsoft.Extensions.StackTrace.Sources
parameterType = parameterType.GetElementType();
}
parameterTypeString = TypeNameHelper.GetTypeDisplayName(parameterType, fullName: false, includeGenericParameterNames: true);
parameterTypeString = TypeNameHelper.GetTypeDisplayName(parameterType!, fullName: false, includeGenericParameterNames: true);
}
return new ParameterDisplayInfo