mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
C#: Don't generate stubs for the record Clone method.
This commit is contained in:
@@ -557,6 +557,9 @@ internal sealed class StubVisitor : SymbolVisitor
|
||||
});
|
||||
}
|
||||
|
||||
private static bool ExcludeMethod(IMethodSymbol symbol) =>
|
||||
symbol.Name == "<Clone>$";
|
||||
|
||||
private void StubMethod(IMethodSymbol symbol, IMethodSymbol? explicitInterfaceSymbol, IMethodSymbol? baseCtor)
|
||||
{
|
||||
var methodKind = explicitInterfaceSymbol is null ? symbol.MethodKind : explicitInterfaceSymbol.MethodKind;
|
||||
@@ -568,7 +571,7 @@ internal sealed class StubVisitor : SymbolVisitor
|
||||
MethodKind.Ordinary
|
||||
};
|
||||
|
||||
if (!relevantMethods.Contains(methodKind))
|
||||
if (!relevantMethods.Contains(methodKind) || ExcludeMethod(symbol))
|
||||
return;
|
||||
|
||||
StubAttributes(symbol.GetAttributes());
|
||||
|
||||
Reference in New Issue
Block a user