Required empty class for reading protocols default value

For code snippet, please refer screenshot. This class is need to create object of protocol to read default values from the extension.

SonarQube version - 9.1.0
Scanner version - 4.6.2
language analyzer - Swift

@jbeleites , can you please help on this.

Hello @shubham.singh,

Thank you for your message.

Without an overall picture of what you are trying to achieve, it’s a bit difficult to have a definite opinion about your example being a false positive or not. I understand it’s not possible to instantiate a protocol by itself. However, at a first glance, it seems to me that you could drop the extension and its logic to your empty class.

Is there a reason for having these default implementations in an extension rather than in the class itself ? Is there another class than TotalFillWithPrimaColorDependencyComponent that extends the protocol ?

Best regards,