Use covariant return types.
Use the covariant return type feature of C# 9 to allow method overrides to be more specific about their return type. By exposing this information, e.g. for Widget.Clone(), callers will have more information. This allows various casts to be removed as the information is now available within the type system.
This commit is contained in:
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
active = false;
|
||||
}
|
||||
|
||||
public override SupportPowerInstance CreateInstance(string key, SupportPowerManager manager)
|
||||
public override DischargeableSupportPowerInstance CreateInstance(string key, SupportPowerManager manager)
|
||||
{
|
||||
return new DischargeableSupportPowerInstance(key, info, manager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user