Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InterfaceOnly inheritance can lead to broken code #16

Closed
miho opened this issue Feb 6, 2019 · 1 comment
Closed

InterfaceOnly inheritance can lead to broken code #16

miho opened this issue Feb 6, 2019 · 1 comment

Comments

@miho
Copy link
Owner

miho commented Feb 6, 2019

To demonstrate the issue, let's look at the following model:

package eu.mihosoft.vmftest.getteronly.vmfmodel;
import eu.mihosoft.vmf.core.*;

@InterfaceOnly
interface WithName {
  @GetterOnly
  String getName();
}

@Immutable
interface ImmutableObj extends WithName {
     // should inherit the 'name' property
}

interface MutableObj extends WithName {
    // should inherit the 'name' property
}

the code generator seems to ignore the fact that ImmutableObj extends WithName and MutableObj inherits the @GetterOnly annotation which leads to a missing setter method.

miho added a commit that referenced this issue Feb 6, 2019
miho added a commit that referenced this issue Feb 6, 2019
- interface-only is equal to its read-only if effectively only
   getter-only properties have been specified. this allows
   immutable and mutable types to share getter-only &
   interface-only super-types
- getter-only properties are correctly inherited by mutable types
   (previously, we required redeclaration of these properties)
miho added a commit that referenced this issue Feb 6, 2019
@miho
Copy link
Owner Author

miho commented Feb 6, 2019

works now

@miho miho closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant