// Generated from "j2kt/TypeLiteralConversion.java"
@file:Suppress(
 "ALWAYS_NULL",
 "PARAMETER_NAME_CHANGED_ON_OVERRIDE",
 "SENSELESS_COMPARISON",
 "UNCHECKED_CAST",
 "UNNECESSARY_LATEINIT",
 "UNNECESSARY_NOT_NULL_ASSERTION",
 "UNREACHABLE_CODE",
 "UNUSED_ANONYMOUS_PARAMETER",
 "UNUSED_PARAMETER",
 "UNUSED_VARIABLE",
 "USELESS_CAST",
 "VARIABLE_IN_SINGLETON_WITHOUT_THREAD_LOCAL",
 "VARIABLE_WITH_REDUNDANT_INITIALIZER",
 "REDUNDANT_ELSE_IN_WHEN")

package j2kt

import javaemul.lang.*
import java.lang.AssertionError
import java.lang.Class
import java.lang.Integer
import kotlin.Any
import kotlin.Array
import kotlin.Int
import kotlin.IntArray
import kotlin.Number
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmStatic
import kotlin.jvm.javaObjectType
import kotlin.jvm.javaPrimitiveType

open class TypeLiteralConversion {
 open fun testSimpleToRaw(): Class<Any> {
  return Simple::class.javaObjectType as Class<Any>
 }

 open fun testSimpleToNonRaw(): Class<Simple> {
  return Simple::class.javaObjectType
 }

 open fun testSimpleToUnboundWildcard(): Class<*> {
  return Simple::class.javaObjectType
 }

 open fun testSimpleBoundWildcard(): Class<out Simple> {
  return Simple::class.javaObjectType
 }

 open fun testGenericToRaw(): Class<Any> {
  return Generic::class.javaObjectType as Class<Any>
 }

 open fun testGenericToNonRaw(): Class<Generic<Any?>> {
  return Generic::class.javaObjectType as Class<Generic<Any?>>
 }

 open fun testGenericToUnboundWildcard(): Class<*> {
  return Generic::class.javaObjectType as Class<*>
 }

 open fun testGenericToBoundWildcard(): Class<out Generic<Any?>> {
  return Generic::class.javaObjectType as Class<Generic<Any?>>
 }

 open fun testPrimitiveToRaw(): Class<Any> {
  return Int::class.javaPrimitiveType!! as Class<Any>
 }

 open fun testPrimitiveToNonRaw(): Class<Int> {
  return Int::class.javaPrimitiveType!! as Class<Int>
 }

 open fun testPrimitiveToUnboundWildcard(): Class<*> {
  return Int::class.javaPrimitiveType!!
 }

 open fun testPrimitiveToBoundWildcard(): Class<out Number> {
  return Int::class.javaPrimitiveType!!
 }

 open fun testArrayToRaw(): Class<Any> {
  return Array::class.javaObjectType as Class<Any>
 }

 open fun testArrayToNonRaw(): Class<Array<String>> {
  return Array::class.javaObjectType as Class<Array<String>>
 }

 open fun testArrayToUnboundWildcard(): Class<*> {
  return Array::class.javaObjectType as Class<Array<String?>>
 }

 open fun testPrimitiveArrayToRaw(): Class<Any> {
  return IntArray::class.javaObjectType as Class<Any>
 }

 open fun testPrimitiveArrayToNonRaw(): Class<IntArray> {
  return IntArray::class.javaObjectType
 }

 open fun testPrimitiveArrayToUnboundWildcard(): Class<*> {
  return IntArray::class.javaObjectType
 }

 companion object {
  @JvmStatic
  fun testGetSimpleInstance(): Simple {
   return TypeLiteralConversion.getInstance<Simple>(Simple::class.javaObjectType)
  }

  @JvmStatic
  fun testGetIntegerInstance(): Int {
   return TypeLiteralConversion.getInstance<Int>(Int::class.javaObjectType)
  }

  @JvmStatic
  fun testGetPrimitiveInstance(): Int {
   return TypeLiteralConversion.getInstance<Int>(
    Integer.TYPE,
   )!!.toInt()
  }

  @JvmStatic
  fun testGetArrayInstance(): Array<String> {
   return TypeLiteralConversion.getInstance<Array<String?>>(
    Array::class.javaObjectType as Class<Array<String?>>,
   ) as Array<String>
  }

  @JvmStatic
  fun testGetSimpleEnumInstance(): SimpleEnum {
   return TypeLiteralConversion.getInstance<SimpleEnum>(SimpleEnum::class.javaObjectType)
  }

  @JvmStatic
  fun testGetRecursiveInstance(): Recursive<*> {
   return TypeLiteralConversion.getInstance<Recursive<*>>(
    Recursive::class.javaObjectType as Class<Recursive<*>>,
   ) as Recursive<*>
  }

  @JvmStatic
  fun testGetRecursiveSpecializedInstance(): RecursiveSpecialized {
   return TypeLiteralConversion.getInstance<RecursiveSpecialized>(RecursiveSpecialized::class.javaObjectType)
  }

  @JvmStatic
  fun <T> getInstance(clazz: Class<T & Any>): T {
   throw AssertionError()
  }
 }

 interface Simple

 enum class SimpleEnum {
  ;
 }

 interface Generic<T>

 open class Recursive<T: Recursive<T>>

 open class RecursiveSpecialized: Recursive<RecursiveSpecialized>()
}
