// Generated from "jsoverlay/Main.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 jsoverlay

import javaemul.lang.*
import jsinterop.annotations.JsFunction
import jsinterop.annotations.JsOverlay
import jsinterop.annotations.JsPackage
import jsinterop.annotations.JsType
import kotlin.Any
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmField
import kotlin.jvm.JvmStatic

open class Main {
 open fun test() {
  val n: NativeJsTypeWithOverlay = NativeJsTypeWithOverlay()
  n.callM()
  NativeJsTypeWithOverlay.`fun`()
  NativeJsTypeWithOverlay.n()
  NativeJsTypeWithOverlay.bar_private_2()
  n.foo_private_2()
  val a: Int = NativeJsTypeWithOverlayConstant.COMPILE_TIME_CONSTANT + NativeJsTypeWithOverlay.nonJsOverlayField
  NativeJsTypeWithOverlay.staticField = null
  NativeJsTypeWithOverlay.varargs(1, 2, 3)
  n.baz_private_2()
  val b: String = NativeJsTypeWithOverlayConstant.STRING_COMPILE_TIME_CONSTANT + NativeJsTypeInterfaceWithOverlay.staticField
 }

 open fun testOverlayInterface(foo: NativeJsTypeInterfaceWithOverlay?) {
  foo!!.m()
  foo!!.callM()
 }

 companion object {
  @JvmStatic
  fun testOverlayInterfaceImpl() {
   val foo: NativeJsTypeInterfaceWithOverlay = NativeJsTypeInterfaceWithOverlayImpl()
   foo.m()
   foo.callM()
  }
 }

 @JsType(namespace = "test.foo", isNative = true)
 fun interface NativeJsTypeInterfaceWithOverlay {
  fun m(): Int

  @JsOverlay
  fun callM(): Int {
   return this@NativeJsTypeInterfaceWithOverlay.m()
  }

  companion object {
   @JvmField
   @JsOverlay
   val staticField: Any? = Any()
  }
 }

 open class NativeJsTypeInterfaceWithOverlayImpl internal constructor(): NativeJsTypeInterfaceWithOverlay {
  override fun m(): Int {
   return 0
  }
 }

 @JsType(namespace = "test.foo", isNative = true)
 open class NativeJsTypeWithOverlay {
  external open fun m(): Int

  @JsOverlay
  fun callM(): Int {
   return this.m()
  }

  @JsOverlay
  internal fun foo_private_2(): Int {
   return 1
  }

  @JsOverlay
  internal fun baz_private_2(): Int {
   return 1
  }

  @JsOverlay
  fun overlayWithJsFunction() {
   object : Intf {
    override fun run() {}
   }.run()
  }

  @JsOverlay
  fun overlay() {}

  companion object {
   @JvmField
   var nonJsOverlayField: Int = 0

   @JvmField
   @JsOverlay
   var staticField: Any? = Any()

   @JvmStatic
   external fun n()

   @JvmStatic
   @JsOverlay
   fun `fun`(): Int {
    return 1
   }

   @JvmStatic
   @JsOverlay
   internal fun bar_private_2(): Int {
    return 1
   }

   @JvmStatic
   @JsOverlay
   fun varargs(vararg a: Int): Int {
    return a!![0]
   }

   @JvmStatic
   @JsOverlay
   fun overlay(o: NativeJsTypeWithOverlay?) {}
  }
 }

 @JsType(name = "Object", namespace = JsPackage.GLOBAL, isNative = true)
 open class NativeJsTypeWithOverlayConstant internal constructor() {
  companion object {
   @JsOverlay
   const val COMPILE_TIME_CONSTANT: Int = 10

   @JsOverlay
   const val STRING_COMPILE_TIME_CONSTANT: String = "10"
  }
 }

 @JsFunction
 fun interface Intf {
  fun run()
 }
}

@JsType(name = "?", namespace = JsPackage.GLOBAL, isNative = true)
interface ParameterizedNativeInterface<T> {
 @JsOverlay
 fun <T_1, S> shadowsTypeVariable(param1: T_1, param2: S) {}

 @JsOverlay
 fun <T_1, S> shadowsTypeVariable(param1: T_1, param2: Int) {}
}
