Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aecc9e2

Browse files
committed
C#: Fix LGTM warnings
1 parent 55b41cf commit aecc9e2

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/VariableDeclaration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public static Expression CreateParenthesized(Context cx, VarPatternSyntax varPat
7575
{
7676
var decl = Create(cx, variable, Type.Create(cx, local.Type), true, tuple, child0++);
7777
var id = single.Identifier;
78-
var declSymbol = cx.Model(single).GetDeclaredSymbol(single);
7978
var location = cx.Create(id.GetLocation());
8079
LocalVariable.Create(cx, local, decl, true, location);
8180
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/Statements/Case.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void PopulatePattern(PatternSyntax pattern, TypeSyntax optionalType, Syn
7575

7676
switch (designation)
7777
{
78-
case SingleVariableDesignationSyntax single:
78+
case SingleVariableDesignationSyntax _:
7979
if (cx.Model(pattern).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
8080
{
8181
var type = Type.Create(cx, symbol.Type);
@@ -92,7 +92,7 @@ private void PopulatePattern(PatternSyntax pattern, TypeSyntax optionalType, Syn
9292
case null:
9393
break;
9494
case ParenthesizedVariableDesignationSyntax paren:
95-
Expressions.VariableDeclaration.CreateParenthesized(cx, pattern as VarPatternSyntax, paren, this, 0);
95+
Expressions.VariableDeclaration.CreateParenthesized(cx, (VarPatternSyntax)pattern, paren, this, 0);
9696
break;
9797
default:
9898
throw new InternalError(pattern, "Unhandled designation in case statement");

0 commit comments

Comments
 (0)