Search code examples
androidkotlinkotlin-android-extensionskotlin-extension

what is the equivalent of this java code to kotlin


what is the equivalent kotlin of the following java code:

F f=new F();
convert(f, HashMap.class);

This is what i have tried so far

val f = F()
convert(f, HashMap<*, *>::class.java)

This is the error i am getting:

Only classes are allowed on the left hand side of a class literal


Solution

  • I think you could just do this:

    convert(form, HashMap::class.java)