https://kotlinlang.org logo
#mockk
Title
# mockk
p

Paul Martin

05/07/2020, 5:41 PM
hi guys. i'm trying to mock the response of an overloaded function, something like this:
Copy code
every { foo.bar(any()) } returns baz
foo.bar()
has got two overloaded implementations with different parameter types, and so the compiler is giving me an "overload resolution ambiguity" error because it can't tell which one i'm talking about. is it possible to specify the type of the parameter while still allowing it to be called with
any()
? or is there another approach i could use?