Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
-
Windows 7 x64, Java 7 x64
Description
Don't know if this bug has been reported before (didn't find anything while looking)
@CompileStatic class M { public void r() { Sql sql = Sql.newInstance("jdbc:mysql://localhost/dummy", "dummy", "dummy", "com.mysql.jdbc.Driver") } } (new M()).r()
fails with
Caught: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: groovy.sql.Sql(java.lang.String, java.lang.String, java.lang.String, java.lang.String) groovy.lang.GroovyRuntimeException: Could not find matching constructor for: groovy.sql.Sql(java.lang.String, java.lang.String, java.lang.String, java.lang.String) at M.r(Test2.groovy:11) at M$r.call(Unknown Source) at Test2.run(Test2.groovy:18)
Looks like DefaultGroovyMethods.newInstance get's called instead.
Removing @CompileStatic fixes the problem
Attachments
Issue Links
- duplicates
-
GROOVY-5573 Type checker incorrectly selecting DGM return type instead of actual return type
- Closed