-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
This issue is related to a resolved issue #2644, which was resolved in 4.7.0 by #2664.
As per the comment by @perlun in the above PR: #2664 (comment)
@big-andy-coates I found a similar semi-related issue I think... With 4.7.0, this now works correctly:
doAnswer(answerVoid((VoidAnswer2<String, Object[]>)
logger::info
)).when(mock)
.info(any(), (Object[]) any());
However, if I try to use this form which is slightly more ergonomic:
doAnswer( answerVoid( (VoidAnswer2<String, Object[]>)
logger::info
) ).when( mock )
.info( any(), any( Object[].class ) );
...the mocking will fail to intercept these method calls. 🤔 No error when creating the mock, but it just won't detect the method calls as expected.
I presume this has again something to do with the varargs parsing. javac
resolves those two calls to the correct/same logger.info()
overload, so so far so good.
Do you want me to create a separate issue/repro repo for this? I'm not even sure if it's something that can be (easily) fixed, I just happened to see it now while trying to "clean up our code"... 😅
Originally posted by @perlun in #2664 (comment)