mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
C#: Minor edits
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
|
||||
static TypeSyntax GetElementType(TypeSyntax type)
|
||||
{
|
||||
switch(type)
|
||||
switch (type)
|
||||
{
|
||||
case ArrayTypeSyntax ats:
|
||||
return GetElementType(ats.ElementType);
|
||||
@@ -35,16 +35,16 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
}
|
||||
}
|
||||
|
||||
static Type GetElementType(Type t)
|
||||
static Type GetElementType(Type type)
|
||||
{
|
||||
switch(t)
|
||||
switch (type)
|
||||
{
|
||||
case ArrayType at:
|
||||
return GetElementType(at.ElementType.Type);
|
||||
case NamedType nt when nt.symbol.IsBoundNullable():
|
||||
return nt.TypeArguments.Single();
|
||||
default:
|
||||
return t;
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,4 +180,4 @@ class UsingDiscard
|
||||
}
|
||||
}
|
||||
|
||||
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll /langversion:8.0
|
||||
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll
|
||||
|
||||
Reference in New Issue
Block a user