[ 
https://issues.apache.org/jira/browse/GROOVY-3548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17342153#comment-17342153
 ] 

Eric Milles commented on GROOVY-3548:
-------------------------------------

See also GROOVY-1809

> Method call on instance of java.lang.Class is dispatched to equally named 
> static method on class described by instance
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-3548
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3548
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 1.6.3, 2.4.0-rc-1
>            Reporter: Peter Niederwieser
>            Priority: Major
>
> {code}
> class JavaLangClassUsageTest extends GroovyTestCase {
>   void testCallFooGetNameMethod() {
>     assert Foo.getName() == "Foo.getName" // passes
>   }
>   void testCallJavaLangClassGetNameMethod() {
>     def clazz = new Foo().getClass()
>     assert clazz.getName() == "Foo" // fails, actual: Foo.getName
>   }
> }
> class Foo {
>   static getName() { "Foo.getName" }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to