未验证 提交 83b9863b 编写于 作者: T Tom Needham 提交者: GitHub

Update PopulateSwitchStatementHelpers.cs

Define out variable
上级 8107c99d
...@@ -51,7 +51,7 @@ public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switch ...@@ -51,7 +51,7 @@ public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switch
// Check if the type of the expression is a nullable INamedTypeSymbol // Check if the type of the expression is a nullable INamedTypeSymbol
// if the type is both nullable and an INamedTypeSymbol extract the type argument from the nullable // if the type is both nullable and an INamedTypeSymbol extract the type argument from the nullable
// and check if it is of enum type // and check if it is of enum type
switchExpressionType = switchExpressionType.IsNullable(out underlyingType) ? underlyingType : switchExpressionType; switchExpressionType = switchExpressionType.IsNullable(out var underlyingType) ? underlyingType : switchExpressionType;
if (switchExpressionType?.TypeKind == TypeKind.Enum) if (switchExpressionType?.TypeKind == TypeKind.Enum)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册