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

Generate multiple toProtocol() for runtime polymorphism instead of pick #139

Open
glassesneo opened this issue Jul 5, 2024 · 2 comments
Labels
Status: Available Waiting for working on it Type: ⚠️BREAKING CHANGE⚠️ breaking change Type: Improve Improve features which are working

Comments

@glassesneo
Copy link
Owner

glassesneo commented Jul 5, 2024

protocol Animal:
  proc eat

protocol CanFly:
  proc fly

class Cat impl Animal:
  proc eat =
    discard
  # automatically defined
  proc toProtocol(): Animal

class Bird impl (Animal, CanFly):
  proc eat =
    discard
  proc fly =
    discard
  # automatically defined
  proc toProtocol(): Animal
  proc toProtocol(): CanFly
  proc toProtocol(): Animal & CanFly
@glassesneo
Copy link
Owner Author

converter may be good for it

@glassesneo
Copy link
Owner Author

& operator in #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available Waiting for working on it Type: ⚠️BREAKING CHANGE⚠️ breaking change Type: Improve Improve features which are working
Projects
None yet
Development

No branches or pull requests

1 participant