Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.6
-
None
Description
I have a extension class
class NumberExtension { static Integer plus(Integer self, NullObject right) { return self; } }
However
1 + null
will throw
Ambiguous method overloading for method java.lang.Integer#plus
Because org.codehaus.groovy.runtime.MetaClassHelper#getClassWithNullAndWrapper return null for null argument. Then org.codehaus.groovy.runtime.MetaClassHelper#calculateParameterDistance(java.lang.Class, org.codehaus.groovy.reflection.CachedClass) doesn't return 0 because null != NullObject.class
Attachments
Issue Links
- relates to
-
GROOVY-11196 ambiguous method error for tap on null receiver
- Closed
- links to