You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/01/27 09:59:00 UTC
[jira] [Updated] (GROOVY-4189) Removing a metaClass method
[ https://issues.apache.org/jira/browse/GROOVY-4189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King updated GROOVY-4189:
------------------------------
Fix Version/s: (was: 3.x)
4.x
> Removing a metaClass method
> ---------------------------
>
> Key: GROOVY-4189
> URL: https://issues.apache.org/jira/browse/GROOVY-4189
> Project: Groovy
> Issue Type: Improvement
> Components: groovy-jdk
> Affects Versions: 1.7.2
> Reporter: Tim Yates
> Priority: Minor
> Fix For: 4.x
>
>
> Spotted a question on stackoverflow about removing a metaclass method
> The page here
> http://groovy.codehaus.org/JN3525-MetaClasses
> Says you should be able to do it by setting it to null, but we get this:
> {code}
> String.metaClass.foo = { "${delegate}foo" }
> assert 'kung'.foo() == 'kungfoo'
> String.metaClass.foo = null
> assert 'woo'.foo() == 'woofoo'
> {code}
> That last assert should fail (according to the docs), but it passes
> Is this a documentation issue?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)