File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
grails-core/src/main/groovy/org/grails/compiler
grails-test-suite-uber/src/test/groovy/grails/compiler Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ class ValidateableTypeCheckingExtension extends TypeCheckingDSL {
4141 constraintsClosureCode = constraintsProperty. initialExpression. code
4242 }
4343 constraintsProperty. initialExpression. code = new EmptyStatement ()
44+ } else {
45+ newScope()
4446 }
4547 }
4648
Original file line number Diff line number Diff line change @@ -183,6 +183,35 @@ class SomeClass implements grails.validation.Validateable {
183183 name matches: /[A-Z].*/
184184 }
185185}
186+ ''' )
187+ then : ' no errors are thrown'
188+ c
189+ }
190+
191+ @Issue (' GRAILS-11242' )
192+ void ' Test compiling Validateable with inner class' () {
193+ given :
194+ def gcl = new GroovyClassLoader ()
195+
196+ when : ' a class marked with @GrailsCompileStatic invokes dynamic finders on a non-domain class inside of a method marked with TypeCheckingMode.SKIP'
197+ def c = gcl. parseClass('''
198+ package grails.compiler
199+
200+ import groovy.transform.TypeCheckingMode
201+
202+ @GrailsCompileStatic
203+ class SomeClass implements grails.validation.Validateable {
204+
205+ enum TestKind {
206+ BIG,
207+ SMALL
208+ }
209+
210+ String name
211+ static constraints = {
212+ name matches: /[A-Z].*/
213+ }
214+ }
186215''' )
187216 then : ' no errors are thrown'
188217 c
You can’t perform that action at this time.
0 commit comments