C#: Minor edits

This commit is contained in:
Calum Grant
2019-07-05 13:16:01 +01:00
parent 5613769654
commit dfbb1946d3
2 changed files with 5 additions and 5 deletions

View File

@@ -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;
}
}

View File

@@ -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