How polymorphism support works in Swift-Spyable
mainSwift-Spyable supports method overloading (polymorphism) by generating unique spy properties for each distinct method signature. This allows you to independently mock and verify different overloads of the same method name within a single spy class.
When a protocol is marked with @Spyable, the macro inspects the parameter names, parameter types, and return types to ensure each overload has its own set of tracking properties (e.g., CallsCount, Called, ReceivedValue, and ReturnValue).
@Spyable
protocol DataProcessor {
func compute(value: String) -> String
func compute(value: Int) -> String
func compute(value: Bool) -> String
}