Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Compiler
-
Labels:None
-
Number of attachments :
Description
I would like @Override to be allowed (and verified) on fields that implement an interface.
For instance, this is valid Groovy code:
interface Parent { String getSetting() } class Child implements Parent { final String setting ='my setting' }
I'd like to add the @Override to the field and have the compiler verify that it does override the getter in the parent. It should work on boolean getters too, I suppose.
Issue Links
- is depended upon by
-
GRECLIPSE-1428
Groovy editor does not respect @Override
-
- relates to
-
GROOVY-5413
groovyc should emit errors when @Override is not respected
-
-
GRECLIPSE-1454
no Eclipse compile error for @Override on methods with signatures that don't match that of the parent class
-
Activity
Hamlet D'Arcy
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
I would like @Override to be allowed (and verified) on fields that implement an interface.
For instance, this is valid Groovy code: {code} interface Parent { String getSetting() } class Child implements Parent { final String setting ='my setting' } {code} I'd like to add the @Override to the field and have the compiler verify that it does override the getter in the parent. It should work on setters too. |
I would like @Override to be allowed (and verified) on fields that implement an interface.
For instance, this is valid Groovy code: {code} interface Parent { String getSetting() } class Child implements Parent { final String setting ='my setting' } {code} I'd like to add the @Override to the field and have the compiler verify that it does override the getter in the parent. It should work on boolean getters too, I suppose. |
Paul King
made changes -
| Link | This issue relates to GROOVY-5413 [ GROOVY-5413 ] |
Andrew Eisenberg
made changes -
| Link | This issue is depended upon by GRECLIPSE-1428 [ GRECLIPSE-1428 ] |
Andrew Eisenberg
made changes -
| Link |
This issue relates to |
Pascal Schumacher
made changes -
| Component/s | Compiler [ 13529 ] |
Paul King
made changes -
| Summary | @Override should be allowed (and verified) on fields that implement an interface | @Override should be allowed (and verified) on properties that implement an interface |
Isn't @Override defined by Java and allowed only on methods?