Can I make an interface with variable types? inter...
# codereview
b
Can I make an interface with variable types? interface IProcessor { fun <A> process(f: (A)-> Unit): ProcessorStatus }
✔️ 1
s
are you looking for, just
Copy code
interface Processor<T> {
  fun process(consumer: (T) -> Unit): ProcessorStatus
}
Copy code
class FooProcessor : Processor<Foo> {
  override fun process(consumer: (Foo) -> Unit): ProcessorStatus {
    ...
  }
}
b
Ok that's what I messed up
thanks!
I had the type annotation only at the level of the function