0

I'm using Kotlin in Android development and I would like to create class with two generics, one of them V must be child class of View, and class also should implement some interface MyInterface.

How to do that? I've tried something like this

class Test<T, V>(val value1: String, val map: Map<T, V>) where V: View, MyInterface

or

class Test<T, V>(val value1: String, val map: Map<T, V>) where V: View: MyInterface

but I have no idea what is the correct syntax?

user3626048
  • 706
  • 4
  • 19
  • 52

1 Answers1

2

class Test<T, V: View> (val string: String, val map: Map<T, V>) : MyInterface

Should be the correct syntax.

Omar Silva
  • 301
  • 1
  • 8