If I have a generic type with 2 type parameters, f...
# announcements
j
If I have a generic type with 2 type parameters, for example:
Copy code
data class TableColumn<T,U>(val rawColumn: T, val transformer: (U) ->T)
Is it possible to add a secondary constructor that forces both type parameters to be the same? something like:
Copy code
data class TableColumn<T,U>(val rawColumn: T, val transformer: (U) ->T) {
         constructor(rawColumn: <**U==T**>): this(rawColumn, { it })
   }
basically I want to be able to create a
TableColumn<T,T>
instance by only specifying a single T instance and have the transformer "automatically" do an identity transform.