You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (Jira)" <ji...@apache.org> on 2020/10/28 18:03:00 UTC
[jira] [Commented] (GROOVY-8248) MethodSelectionException when
calling a overloaded method without arguments
[ https://issues.apache.org/jira/browse/GROOVY-8248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17222320#comment-17222320 ]
Daniil Ovchinnikov commented on GROOVY-8248:
--------------------------------------------
[~bigehokie] take a look please
> MethodSelectionException when calling a overloaded method without arguments
> ---------------------------------------------------------------------------
>
> Key: GROOVY-8248
> URL: https://issues.apache.org/jira/browse/GROOVY-8248
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.10
> Reporter: Daniil Ovchinnikov
> Priority: Major
>
> {code}
> def methodWithOverload(a, b) {
> println "$a $b"
> }
> def methodWithOverload(a) {
> methodWithOverload(a, new Object())
> }
> methodWithOverload("hello", "world")
> methodWithOverload("hello")
> methodWithOverload() // MSE here
> {code}
> {noformat}
> Caught: org.codehaus.groovy.runtime.metaclass.MethodSelectionException: Could not find which method methodWithOverload() to invoke from this list:
> public java.lang.Object myscript#methodWithOverload(java.lang.Object)
> public java.lang.Object myscript#methodWithOverload(java.lang.Object, java.lang.Object)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)