jdaugherty commented on code in PR #15759:
URL: https://github.com/apache/grails-core/pull/15759#discussion_r3491609410
##########
grails-core/src/main/groovy/org/grails/compiler/ControllerTagLibTypeCheckingExtension.groovy:
##########
@@ -90,7 +90,10 @@ class ControllerTagLibTypeCheckingExtension extends
GroovyTypeCheckingExtensionS
beforeVisitClass { ClassNode classNode ->
newScope {
- isController =
classNode.name.endsWith(ControllerArtefactHandler.TYPE)
+ // Both controllers and tag libraries dispatch tags at runtime
through the
Review Comment:
This class is now a generic TagLib compilestatic and no longer specific to
controllers. We should rename it.
##########
grails-core/src/main/groovy/org/grails/compiler/ControllerTagLibTypeCheckingExtension.groovy:
##########
@@ -126,6 +129,17 @@ class ControllerTagLibTypeCheckingExtension extends
GroovyTypeCheckingExtensionS
null
}
+ /**
+ * {@code makeDynamic} stores its dynamic-resolution marker on the
enclosing method, so it can only be
+ * used inside a method body. Tags defined the deprecated way - as closure
fields rather than methods -
+ * are type-checked as field initializers with no enclosing method;
silencing there would throw an NPE.
+ * In that case we defer, leaving the call to be reported as a normal type
error rather than crashing
+ * the compiler. Method-based tags (the supported form) always have an
enclosing method.
+ */
+ private boolean canMakeDynamic() {
+ getEnclosingMethod() != null
Review Comment:
If I undersatnd correctly, this means the legacy tag libs aren't supported
now?
--
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]