bito-code-review[bot] commented on PR #15720:
URL: https://github.com/apache/grails-core/pull/15720#issuecomment-4675233891
<!-- Bito Reply -->
The pull request already includes a new test case, 'Test compiling a class
which invokes a chained createCriteria() terminal on a domain class', within
`GrailsCompileStaticCompilationErrorsSpec.groovy`. This test verifies that
chained `createCriteria()` calls (e.g., `.list`, `.get`, `.count`) are
correctly type-checked under `@GrailsCompileStatic`. If further TCK (Technology
Compatibility Kit) coverage is required, you should add similar integration
tests to the dedicated TCK test suite modules, as the current tests are located
in the `grails-test-suite-uber` module.
**grails-test-suite-uber/src/test/groovy/grails/compiler/GrailsCompileStaticCompilationErrorsSpec.groovy**
```
void 'Test compiling a class which invokes a chained createCriteria()
terminal on a domain class'() {
given:
def gcl = new GroovyClassLoader()
when: 'the criteria builder closure is the argument to a terminal
chained directly on createCriteria()'
def c = gcl.parseClass('''
package grails.compiler
@GrailsCompileStatic
class SomeClass {
def someMethod() {
Person.createCriteria().list {
cache true
eq 'name', 'Anakin'
}
// ... other terminals
}
}
'''.stripIndent())
then: 'no errors are thrown'
c
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]