File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -728,6 +728,9 @@ public static bool IsUnboundGenericType(this INamedTypeSymbol type) =>
728728 public static INamedTypeSymbol ? GetNonObjectBaseType ( this ITypeSymbol symbol , Context cx ) =>
729729 symbol is ITypeParameterSymbol || SymbolEqualityComparer . Default . Equals ( symbol . BaseType , cx . Compilation . ObjectType ) ? null : symbol . BaseType ;
730730
731+ public static IMethodSymbol GetBodyDeclaringMethodSymbol ( this IMethodSymbol method ) =>
732+ method . PartialImplementationPart ?? method ;
733+
731734 [ return : NotNullIfNotNull ( nameof ( symbol ) ) ]
732735 public static IEntity ? CreateEntity ( this Context cx , ISymbol symbol )
733736 {
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ protected virtual void PopulateMethodBody(TextWriter trapFile)
8585 else
8686 Expression . Create ( Context , expr ! , this , 0 ) ;
8787
88- NumberOfLines ( trapFile , BodyDeclaringSymbol , this ) ;
88+ NumberOfLines ( trapFile , Symbol , this ) ;
8989 } ) ;
9090 }
9191 }
Original file line number Diff line number Diff line change @@ -14,14 +14,12 @@ protected OrdinaryMethod(Context cx, IMethodSymbol init)
1414
1515 public override string Name => Symbol . GetName ( ) ;
1616
17- protected override IMethodSymbol BodyDeclaringSymbol => Symbol . PartialImplementationPart ?? Symbol ;
18-
1917 public IMethodSymbol SourceDeclaration => Symbol . OriginalDefinition ;
2018
2119 public override Microsoft . CodeAnalysis . Location ReportingLocation =>
2220 IsCompilerGeneratedDelegate ( )
2321 ? Symbol . ContainingType . GetSymbolLocation ( )
24- : BodyDeclaringSymbol . GetSymbolLocation ( ) ;
22+ : Symbol . GetSymbolLocation ( ) ;
2523
2624 public override bool NeedsPopulation =>
2725 ( base . NeedsPopulation || IsCompilerGeneratedDelegate ( ) ) &&
@@ -77,7 +75,7 @@ Symbol.ContainingType is INamedTypeSymbol nt &&
7775 cx . ExtractionContext . Logger . LogWarning ( "Reduced extension method symbols should not be directly extracted." ) ;
7876 }
7977
80- return OrdinaryMethodFactory . Instance . CreateEntityFromSymbol ( cx , method ) ;
78+ return OrdinaryMethodFactory . Instance . CreateEntityFromSymbol ( cx , method . GetBodyDeclaringMethodSymbol ( ) ) ;
8179 }
8280
8381 private class OrdinaryMethodFactory : CachedEntityFactory < IMethodSymbol , OrdinaryMethod >
You can’t perform that action at this time.
0 commit comments