Revert "Add ICloneable support to ComponentNetworkGenerator (#5656)"

This reverts commit e14537074e.
This commit is contained in:
Leon Friedrich
2025-02-20 14:19:50 +11:00
committed by GitHub
parent 3bbbabf238
commit 9b3e0ad045

View File

@@ -746,17 +746,7 @@ public partial class {componentName}{deltaInterface}
private static bool IsCloneType(ITypeSymbol type)
{
if (type is not INamedTypeSymbol named)
{
return false;
}
if (ImplementsInterface(named, nameof(ICloneable)))
{
return true;
}
if (!named.IsGenericType)
if (type is not INamedTypeSymbol named || !named.IsGenericType)
{
return false;
}
@@ -768,18 +758,5 @@ public partial class {componentName}{deltaInterface}
_ => false
};
}
private static bool ImplementsInterface(ITypeSymbol type, string interfaceName)
{
foreach (var interfaceType in type.AllInterfaces)
{
if (interfaceType.ToDisplayString().Contains(interfaceName))
{
return true;
}
}
return false;
}
}
}