<@UAA7Q4ZCH> I can’t tell the full context from wh...
# getting-started
k
@bjonnh I can’t tell the full context from what you posted (is this just the Boolean implementation? Or is the presence of
Boolean
in your code because the function must always deal with Boolean no matter which type of Term?) Assuming the pastebin contains the Output that only deals with Boolean, then why not
Copy code
class Output<U: Term<V>, V>(val name: String) {
   private val callbacks: MutableList<suspend (U) -> V> = mutableListOf()
   // ...
}
and then have
class Term
be
class Term<V>
instead? I’m a relative neophyte with generics, though, so could be wrong. Plus I don’t have all your code, so maybe my suggestion doesn’t work anyway.
b
V can be Int, Double, Pair, and any custom thing I make
But the callback function always returns boolean
k
OK so what’s wrong with what you pasted in Pastebin?
b
I had issues with the type inference, sorry I should have killed my question.
I solved it by creating new classes for the types.