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
shh for Runnable #29
Comments
ProblemPassing a lambda expression or method reference for AnnoyingRunnable or AnnoyingRunner to shh has an issue with the following error.
Both AnnoyingRunnable and AnnoyingRunner have SAM with exactly the same method signature so the compiler can't figure out the given lambda expression to method reference is for which FunctionalInterface type. |
SolutionThe problem described above has been solved by using Liskov substitution principle. Before
After
|
- There is a shh method taking AnnoyingRunnable then returns Runner so that any nullary function case can be solved.
- There is a shh method taking AnnoyingRunnable then returns Runner so that any nullary function case can be solved.
This is a sub-task for shh for more functions (#28).
AnnoyingRunnable
andAnnoyingRunner
typesAnnoyingRunnable
andAnnoyingRunner
The text was updated successfully, but these errors were encountered: