Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.8.0, 1.8.3
-
Fix Version/s: None
-
Component/s: None
-
Labels:
-
Environment:OS X 10.7.2
-
Number of attachments :
Description
Using the mixin annotation I can add mixins to classes, however those mixins cannot fulfill abstract class requirements. For example, the following code throws compilation exceptions:
class M
{ def foo = 11 def bar = 12 }abstract class A
{ abstract foo }@Mixin(M)
class B extends A {
}
def b = new B()
print "$
\n"
print "$
\n"
When attempting to run this code I get:
/private/tmp/runner.groovy: 10: Can't have an abstract method in a non-abstract class. The class 'B' must be declared abstract or the method 'java.lang.Object getFoo()' must be implemented.
@ line 10, column 1.
@Mixin(M)
^
/private/tmp/runner.groovy: 10: Can't have an abstract method in a non-abstract class. The class 'B' must be declared abstract or the method 'void setFoo(java.lang.Object)' must be implemented.
@ line 10, column 1.
@Mixin(M)
^
2 errors
Activity
| Field | Original Value | New Value |
|---|---|---|
| Issue Type | Bug [ 1 ] | Sub-task [ 7 ] |
| Parent | GROOVY-5990 [ 144083 ] |