Skip to content

Instantly share code, notes, and snippets.

@ntngel1
Created April 2, 2019 15:37
Show Gist options
  • Save ntngel1/b443c3daca2052269581b34bcf41291b to your computer and use it in GitHub Desktop.
Save ntngel1/b443c3daca2052269581b34bcf41291b to your computer and use it in GitHub Desktop.
abstract class UseCase <in P, out T> {
abstract fun execute(param: P): T
}
class FooUseCase : UseCase<Unit, Unit>() {
override fun execute(param: Unit) {
}
}
val fooUseCase = FooUseCase()
fooUseCase.execute() // Doesn't work
fooUseCase.execute(Unit) // Works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment