mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: For implicit constructors, pick a unique source location as reporting location (if any).
This commit is contained in:
@@ -222,7 +222,8 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
|
||||
if (Symbol.IsImplicitlyDeclared)
|
||||
{
|
||||
return ContainingType!.ReportingLocation;
|
||||
var best = Symbol.Locations.Where(l => l.IsInSource).BestOrDefault();
|
||||
return best ?? ContainingType!.ReportingLocation;
|
||||
}
|
||||
|
||||
return Symbol.ContainingType.Locations.FirstOrDefault();
|
||||
|
||||
Reference in New Issue
Block a user