C#: Refine UnboundGeneric and ConstructedGeneric

This commit is contained in:
Tom Hvitved
2020-04-23 14:51:57 +02:00
parent 8a01023dee
commit c324c388d0
8 changed files with 34 additions and 74 deletions

View File

@@ -340,7 +340,6 @@ namespace Semmle.Extraction.CSharp.Entities
if (isFullyConstructed)
{
trapFile.is_constructed(this);
trapFile.constructed_generic(this, Method.Create(Context, ConstructedFromSymbol));
foreach (var tp in symbol.GetAnnotatedTypeArguments())
{
@@ -354,7 +353,6 @@ namespace Semmle.Extraction.CSharp.Entities
}
else
{
trapFile.is_generic(this);
foreach (var typeParam in symbol.TypeParameters.Select(tp => TypeParameter.Create(Context, tp)))
{
trapFile.type_parameters(typeParam, child, this);

View File

@@ -40,8 +40,6 @@ namespace Semmle.Extraction.CSharp.Entities
}
else if (symbol.IsReallyUnbound())
{
trapFile.is_generic(this);
for (int i = 0; i < symbol.TypeParameters.Length; ++i)
{
TypeParameter.Create(Context, symbol.TypeParameters[i]);
@@ -52,7 +50,6 @@ namespace Semmle.Extraction.CSharp.Entities
}
else
{
trapFile.is_constructed(this);
trapFile.constructed_generic(this, Type.Create(Context, symbol.ConstructedFrom).TypeRef);
for (int i = 0; i < symbol.TypeArguments.Length; ++i)

View File

@@ -306,16 +306,6 @@ namespace Semmle.Extraction.CSharp
trapFile.WriteTuple("indexers", propKey, name, declaringType, memberType, unboundProperty);
}
internal static void is_constructed(this TextWriter trapFile, IEntity typeOrMethod)
{
trapFile.WriteTuple("is_constructed", typeOrMethod);
}
internal static void is_generic(this TextWriter trapFile, IEntity typeOrMethod)
{
trapFile.WriteTuple("is_generic", typeOrMethod);
}
internal static void local_function_stmts(this TextWriter trapFile, Entities.Statements.LocalFunction fnStmt, LocalFunction fn)
{
trapFile.WriteTuple("local_function_stmts", fnStmt, fn);