you should add a marker interface `interface Promo...
# announcements
k
you should add a marker interface
interface Promotable
to those classes and use
fun <T> foo(factory: () -> T) where T: ChessPiece, T: Promotable