Skip to content

Commit

Permalink
fix: compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Sep 8, 2020
1 parent fc3c5a1 commit 8921eab
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,15 @@ public class IgnoresAccessChecksToAttribute : System.Attribute
return AddSyntaxTrees(syntaxTree);
}

private static bool ContainsTypeWithName(INamespaceSymbol @namespace, string name, string current = null)
private static bool ContainsTypeWithName(NamespaceSymbol @namespace, string name, string? current = null)
{
current = current == null ? "" : $"{current}{@namespace.Name}.";
foreach (var member in @namespace.GetMembers().Where(m => name.Contains(m.Name)))
{
switch (member)
{
case INamespaceSymbol asNamespace when ContainsTypeWithName(asNamespace, name, current):
case INamedTypeSymbol asType when $"{current}{asType.Name}" == name:
case NamespaceSymbol asNamespace when ContainsTypeWithName(asNamespace, name, current):
case NamedTypeSymbol asType when $"{current}{asType.Name}" == name:
return true;
}
}
Expand Down

0 comments on commit 8921eab

Please sign in to comment.