Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-9
-
Fix Version/s: 1.0-beta-10
-
Component/s: None
-
Labels:None
-
Environment:Windows XP, Java 1.4.2_06
-
Number of attachments :
Description
The following code:
def foo(double x, y) {
println "x: "+x
println "y: "+y
}
foo(10.0d, 0)
causes Groovy to complain that the value passed to y is the wrong type. Making foo a member function of a class (in another file), and giving it three arguments, the function runs but y is null and the value that should go to y, goes to the third arg. At one point I had it triggering an internal error in the JVM.
Changing double to Double fixes the problem.
Issue Links
- is duplicated by
-
GROOVY-669
groovyc creates class files that does not verify (java.lang.VerifyError)
-
-
GROOVY-564
Verify error with polymorphic functions
-
Activity
james strachan
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 1.0-beta-10 [ 11467 ] | |
| Resolution | Fixed [ 1 ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
james strachan
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
james strachan
made changes -
| Status | Reopened [ 4 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] |
Martin C. Martin
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
Martin C. Martin
made changes -
| Attachment | AsmClassGenerator2.diff [ 13877 ] |
blackdrag blackdrag
made changes -
| Link |
This issue is duplicated by |
blackdrag blackdrag
made changes -
| Link |
This issue is duplicated by |
Martin C. Martin
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Reopened [ 4 ] | Closed [ 6 ] |
I spent a while on it this evening, and couldn't find the problem. But I did discover that you don't need the function call or the first println, although you do need to access y. So the shortest code that produces this bug is:
def foo(double x, y) {
y
}
Everything looks fine, and the methodType in AsmClassGenerator2.visitMethod() is right:
(DLjava/lang/Object;)Ljava/lang/Object;
Maybe it's a bug in the objectweb ClassWriter?