Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Sample project to reproduce attached
Static checker fails compiling the following code
import groovy.transform.CompileStatic import javax.servlet.ServletContext import javax.servlet.ServletRegistration /** * author: Richard Vowles - http://gplus.to/RichardVowles */ @CompileStatic class ServletExample { public void myMethod(ServletContext ctx) { ctx.getServletRegistrations().each { String name, ServletRegistration sr -> println name } } }
with the message
Groovyc: [Static type checking] - Cannot call org.codehaus.groovy.runtime.DefaultGroovyMethods#each(java.util.Map <java.lang.String, java.lang.Object extends javax.servlet.ServletRegistration>, groovy.lang.Closure) with arguments [java.util.Map <java.lang.String, java.lang.Object extends javax.servlet.ServletRegistration>, groovy.lang.Closure]
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-10576 STC: map putAll fails to match "?" to "Object"
- Closed
- links to