-
Notifications
You must be signed in to change notification settings - Fork 102
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
Clock interface should be a "fun" interface #273
Comments
When an interface has a single abstract method, it doesn't automatically qualify to be a functional interface. We can however consider providing a SAM-like constructor function for
|
That would be fine too. I am looking to use dependency injection to inject Clock instance into code and to be able to inject an instance that I can easily control. What I am doing now is that I have:
I guess though since you you have a companion object I can go ahead and create such a function as an extension. |
For what it's worth, requiring that |
Given that #17 seems to now be going the way of not changing Clock interface and #382 proposes moving Clock to the standard library, i once again propose that Clock be made a a fun interface. Agreed it is a ver small benefit, but it also has basically zero cost |
Since it is a SAM should be declared as a fun interface to allow using a lambda to provide an implementation.
The text was updated successfully, but these errors were encountered: