We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
singleton
It would be useful to be able to apply singleton to type variables as well as concrete types. As a motivating example consider this simple event bus:
interface _Subscriber[E] def call: (E event) -> void end class EventBus def subscribe: [E] (_Subscriber[E] subscriber, to: singleton(E)) -> void def dispatch: (untyped event) -> void end
Here I want to specify that EventBus#subscribe expects the subscriber to handle events of the type given as the to: argument.
EventBus#subscribe
subscriber
to:
The text was updated successfully, but these errors were encountered:
I faced such problem too
For example, in my case I would like to do smth like:
class Builder def self.build: [C] (singleton(C) class) -> Array[C] end
Sorry, something went wrong.
Class
Module
Class[I]
Module[I]
No branches or pull requests
It would be useful to be able to apply
singleton
to type variables as well as concrete types. As a motivating example consider this simple event bus:Here I want to specify that
EventBus#subscribe
expects thesubscriber
to handle events of the type given as theto:
argument.The text was updated successfully, but these errors were encountered: