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

Simplify algebraic method declarations. Rewrite inheritance for methods #4

Open
tnowacki opened this issue Sep 13, 2018 · 0 comments
Open

Comments

@tnowacki
Copy link

Currently algebraic method declarations can be used for any valid child of the given type.
We should limit it to only children declared in the given class with 'children'

So

base class X1 {
  fun no(): void 
  | C1() -> void // SHOULD ERROR  
}
class C1() extends X1

base class X {
  children  = A() | B() 
  fun no(): void 
  | A() -> void // Valid!
  | C() -> void // SHOULD ERROR 
  | X _ -> void // Valid!
}
class C() extends X

Doing this will make a lot of the override rules MUCH simpler.
After this is done, the whole pass for method inheritance can probably be rewritten and simplified

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