title: Groovy mixin combined with Gradle DefaultTask results in runtime error
body: <p>To explain my problem in the simplest way, I'll first show you a Groovy script that does work and then add some Gradle sauce which breaks it.</p>
  
  <p>The working script:</p>
  
  <pre><code>class MyMixin {
      String myname = 'max'
  }
  
  @Mixin(MyMixin)
  class MyClass {}
  
  MyClass c = new MyClass()
  println 'hello ' + c.myname
  </code></pre>
  
  <p>This prints out "hello max" as expected. Now let's replace that <code>MyClass</code> with a Gradle task class. For this we extend <a href="http://gradle.org/docs/current/javadoc/org/gradle/api/DefaultTask.html" rel="nofollow">DefaultTask</a> and use the <code>@TaskAction</code> annotation.</p>
  
  <pre><code>@Mixin(MyMixin)
  class MyTask extends DefaultTask {
  
      @TaskAction
      void sayHello() {
          println 'hello ' + myname
      }
  }
  </code></pre>
  
  <p>If we now install this Gradle task and execute it, we get the following runtime error:</p>
  
  <pre><code>Execution failed for task ':myproject:mytask'.
  &gt; MyTask.getMyname()Ljava/lang/String;
  </code></pre>
  
  <p>What's funny is that this only happens with methods returning something. <code>void</code> methods execute just fine.</p>
  
  <p>So the question is simple: <strong>how can I get my mixin to cooperate with my Gradle task?</strong> (FYI: it doesn't seem to be related to inheritance; I checked that, but didn't include it in the sample script to keep it simple. I have also tested with a runtime mixin instead of compile-time: the result is the same).</p>