Skip to content

Commit a261cba

Browse files
committed
C#: Fix type ID generation from merge
1 parent ce188c0 commit a261cba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

csharp/extractor/Semmle.Extraction.CSharp/SymbolExtensions.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,7 @@ private static void BuildAssembly(IAssemblySymbol asm, TextWriter trapFile, bool
234234

235235
public static void BuildNamedTypeId(this INamedTypeSymbol named, Context cx, TextWriter trapFile, Action<Context, TextWriter, ITypeSymbol> subTermAction)
236236
{
237-
bool prefixAssembly = false;
238-
if (named.IsAnonymous()) prefixAssembly = true;
239-
if (named.ContainingAssembly is null) prefixAssembly = false;
240-
241-
if (prefixAssembly)
242-
BuildAssembly(named.ContainingAssembly, trapFile);
237+
bool prefixAssembly = !(named.ContainingAssembly is null);
243238

244239
if (named.IsTupleType)
245240
{
@@ -263,6 +258,8 @@ public static void BuildNamedTypeId(this INamedTypeSymbol named, Context cx, Tex
263258
}
264259
else if (named.ContainingNamespace != null)
265260
{
261+
if (prefixAssembly)
262+
BuildAssembly(named.ContainingAssembly, trapFile);
266263
named.ContainingNamespace.BuildNamespace(cx, trapFile);
267264
}
268265

0 commit comments

Comments
 (0)