-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE during compilation of spec while testing a method with vararg parameter #1202
Comments
Without looking further, if those actually are your dependencies, you will get other problems too. |
Ah, despite your dependency declaration, the conflict resolution uses Groovy 3, otherwise it would not even be valid Groovy syntax in Groovy 2 where you cannot use array initializers like |
Ah, that was the problem 👍 . I changed the dependency with:
and replaced the line:
with
and it works. Big thanks !!! |
Please do not close this issue, as I said, this is still a bug in the Groovy 3 variant |
Besides that you can also simply do |
This is enough for reproduction actually: class Foo extends Specification {
def foo() {
expect:
new Object[]{}
}
} |
Sorry for closing the issue. I don't know the conventions. I see that you opened the corresponding ticket so I assueme it all right. Thanks for the help. Good day! |
If you don't mind, please reopen. |
Ok, no problem. Reopened. |
Issue description
The spock test fail to compile using
gradle :test
while testing method with vararg parameter. The compilation fails with the following error:How to reproduce
./gradlew :test
Link to a gist or similar
spock-npe-bug gist
Additional Environment information
Java/JDK
Groovy version
Build tool version
Gradle
Tested with gradlew 6.1.1 as well as my standalone gradle 5.1.1 installation
Operating System
Windows 10
Build-tool dependencies used
Gradle/Grails
The text was updated successfully, but these errors were encountered: