Skip to content

Verify blows up with groovy.lang.MissingPropertyException #2150

@boris-petrov

Description

@boris-petrov

Describe the bug

@Verify
private void foo(a, b) {
  a.every { it == b }
}

And call it with foo([1, 2, 3], 2). Leads to:

a.every { it == b }
| |
| groovy.lang.MissingPropertyException: No such property: $spock_errorCollector for class: com.company.SomeSpec
|   at com.company.SomeSpec.foo_closure3(SomeSpec.groovy:234)
|   at com.company.SomeSpec.foo(SomeSpec.groovy:234)
|   at com.company.SomeSpec.bar(SomeSpec.groovy:219)
[1, 2, 3]
    at app//com.company.SomeSpec.foo(SomeSpec.groovy:234)
    at com.company.SomeSpec.bar(SomeSpec.groovy:219)

    Caused by:
    groovy.lang.MissingPropertyException: No such property: $spock_errorCollector for class: com.company.SomeSpec
        at com.profuzdigital.data_server.types.SomeSpec.foo_closure3(SomeSpec.groovy:234)
        ... 2 more

To Reproduce

Check the code above.

Expected behavior

No error.

Actual behavior

The error above.

Java version

openjdk version "24.0.1" 2025-04-15

Buildtool version

Gradle 8.14-rc-2

What operating system are you using

Linux

Dependencies

Just Spock.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions