Skip to content

Commit

Permalink
Change ContainingType -> ContainingSymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashanth Govindarajan committed Aug 23, 2021
1 parent 1c0de03 commit ff7437d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private static void ProcessPropertyOrMethodAttributes(SymbolAnalysisContext cont
{
if (SymbolIsAnnotatedAsPreview(baseInterfaceMember, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol))
{
string baseInterfaceMemberName = baseInterfaceMember.ContainingType != null ? baseInterfaceMember.ContainingType.Name + "." + baseInterfaceMember.Name : baseInterfaceMember.Name;
string baseInterfaceMemberName = baseInterfaceMember.ContainingSymbol != null ? baseInterfaceMember.ContainingSymbol.Name + "." + baseInterfaceMember.Name : baseInterfaceMember.Name;
context.ReportDiagnostic(propertyOrMethodSymbol.CreateDiagnostic(ImplementsPreviewMethodRule, propertyOrMethodSymbol.Name, baseInterfaceMemberName));
}
}
Expand All @@ -404,7 +404,7 @@ private static void ProcessPropertyOrMethodAttributes(SymbolAnalysisContext cont
ISymbol overridden = propertyOrMethodSymbol.GetOverriddenMember();
if (SymbolIsAnnotatedAsPreview(overridden, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol))
{
string overriddenName = overridden.ContainingType != null ? overridden.ContainingType.Name + "." + overridden.Name : overridden.Name;
string overriddenName = overridden.ContainingSymbol != null ? overridden.ContainingSymbol.Name + "." + overridden.Name : overridden.Name;
context.ReportDiagnostic(propertyOrMethodSymbol.CreateDiagnostic(OverridesPreviewMethodRule, propertyOrMethodSymbol.Name, overriddenName));
}
}
Expand Down Expand Up @@ -551,11 +551,11 @@ private static bool OperationUsesPreviewFeatures(OperationAnalysisContext contex
if (SymbolIsAnnotatedOrUsesPreviewTypes(methodSymbol, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol, out referencedPreviewSymbol))
{
// Constructor symbols have the name .ctor. Return the containing type instead so we get meaningful names in the diagnostic message
referencedPreviewSymbol = referencedPreviewSymbol.ContainingType;
referencedPreviewSymbol = referencedPreviewSymbol.ContainingSymbol;
return true;
}

if (SymbolIsAnnotatedOrUsesPreviewTypes(methodSymbol.ContainingType, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol, out referencedPreviewSymbol))
if (SymbolIsAnnotatedOrUsesPreviewTypes(methodSymbol.ContainingSymbol, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol, out referencedPreviewSymbol))
{
return true;
}
Expand Down

0 comments on commit ff7437d

Please sign in to comment.