Glen/fix interface inheritance types #153
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@sayresRT this should fix your bug and add in your test
The bug was previously that getInheritedProperties would not handle duplicates, and if two parents differed it was just the last one that won out. If the last one happened to equal your current property (as it happened to do in your use case), it would think they're compatible and remove just that one property.
Essentially what I did was rewrite the "getInheritedProperties" method to create a new "collision type" if two parents have differing types for a property. this means that the equality check when removing inherited props will fail and the class will include the property itself.
If you're two degrees away (i.e. your parent inherits incompatible properties), splitting the function into two recursive functions causes single classes to override their parents if they collide, which gives us the functionality that we want.