Skip to content

Commit ce0e756

Browse files
committed
Move method.
1 parent 4e42387 commit ce0e756

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

ReflectionAnalyzers/Helpers/GetX.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,33 @@ bool IsExplicitImplementation(out ISymbol result)
391391
return false;
392392
}
393393

394+
bool HasVisibleMembers(ITypeSymbol type, BindingFlags effectiveFlags)
395+
{
396+
if (!effectiveFlags.HasFlagFast(BindingFlags.NonPublic))
397+
{
398+
return true;
399+
}
400+
401+
if (effectiveFlags.HasFlagFast(BindingFlags.DeclaredOnly))
402+
{
403+
return type.Locations.Any(x => x.IsInSource);
404+
}
405+
406+
var current = type;
407+
while (current != null &&
408+
current != KnownSymbol.Object)
409+
{
410+
if (!current.Locations.Any(x => x.IsInSource))
411+
{
412+
return false;
413+
}
414+
415+
current = current.BaseType;
416+
}
417+
418+
return true;
419+
}
420+
394421
string TrimName()
395422
{
396423
var index = targetMetadataName.IndexOf('`');
@@ -637,33 +664,6 @@ private static bool MatchesFilter(ISymbol candidate, string metadataName, Bindin
637664
return true;
638665
}
639666

640-
private static bool HasVisibleMembers(ITypeSymbol type, BindingFlags effectiveFlags)
641-
{
642-
if (!effectiveFlags.HasFlagFast(BindingFlags.NonPublic))
643-
{
644-
return true;
645-
}
646-
647-
if (effectiveFlags.HasFlagFast(BindingFlags.DeclaredOnly))
648-
{
649-
return type.Locations.Any(x => x.IsInSource);
650-
}
651-
652-
var current = type;
653-
while (current != null &&
654-
current != KnownSymbol.Object)
655-
{
656-
if (!current.Locations.Any(x => x.IsInSource))
657-
{
658-
return false;
659-
}
660-
661-
current = current.BaseType;
662-
}
663-
664-
return true;
665-
}
666-
667667
private static bool TryGetType(ExpressionSyntax expression, SyntaxNodeAnalysisContext context, PooledSet<ExpressionSyntax> visited, out ITypeSymbol result, out Optional<IdentifierNameSyntax> instance)
668668
{
669669
instance = default(Optional<IdentifierNameSyntax>);

0 commit comments

Comments
 (0)