Skip to content

Instantly share code, notes, and snippets.

@mfollett
Created March 1, 2012 22:24
Show Gist options
  • Save mfollett/1953676 to your computer and use it in GitHub Desktop.
Save mfollett/1953676 to your computer and use it in GitHub Desktop.
class M {
protected foo() { println 'foo' }
}
@Mixin(M) class A {
def bar() { foo() }
}
class B extends A {}
def b = new B()
def a = new A()
a.bar() //<-- comment out this line and see the difference
b.metaClass.foo = {println 'winning'}
b.bar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment