spock icon indicating copy to clipboard operation
spock copied to clipboard

Combination of a Mock and data table/pipe variable named `build` causes groovy.lang.MissingMethodException

Open vovencij opened this issue 6 years ago • 1 comments

Issue description

Combination of a Mock and data table/pipe variable named build causes following error:

No signature of method: java.lang.Integer.call() is applicable for argument types: () values: []
Possible solutions: wait(), abs(), any(), wait(long), tap(groovy.lang.Closure), and(java.lang.Number)
groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.call() is applicable for argument types: () values: []
Possible solutions: wait(), abs(), any(), wait(long), tap(groovy.lang.Closure), and(java.lang.Number)

How to reproduce

The minimal test-case is here: https://gist.github.com/vovencij/f0b56c21504936e66f6ec195851daea4

If there are no Mocks used then the test passes, but if there is a Mock in the test, then the test fails. If the variable is renamed, then the exception is not thrown.

Additional Environment information

Java/JDK

11.0.6 Adopt OpenJDK HotSpot

Groovy version

Reproduces both on 3.0.5 and 2.5.4

Build tool version

Gradle

6.5, 6.6.1

Operating System

MacOs 10.15.6

IDE

IntelliJ IDEA 2020.2.2

Build-tool dependencies used

See gist above.

vovencij avatar Oct 01 '20 11:10 vovencij

This is a duplicate of #1200 and already fixed for the next release.

Vampire avatar Oct 01 '20 12:10 Vampire