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

Type inheritance needs a strategy for duplicate keys #21

Open
mtrberzi opened this issue Sep 25, 2014 · 1 comment
Open

Type inheritance needs a strategy for duplicate keys #21

mtrberzi opened this issue Sep 25, 2014 · 1 comment
Labels

Comments

@mtrberzi
Copy link
Member

Currently we have no way of handling duplicate keys for intermediate derived types. There are a few possibilities:

  • Duplicate keys are always an error. (most "correct" approach)
  • Duplicate keys defer to the most specific definition in use (breaks the idea of inheritance)
  • Duplicate keys are allowed if the type of the redefined key is a subtype of (or the same as) the old key. (interesting approach)

I'm in favour of making this an error at all times, since I can't think of a use case where we would want to redefine the type of an inherited key.

@mtrberzi mtrberzi added the small label Sep 25, 2014
@lucaswoj
Copy link
Contributor

My instinct would be to mimic the behavior of properties in classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants