mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 00:21:28 +00:00
57 lines
1.3 KiB
Kotlin
Vendored
57 lines
1.3 KiB
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
|
|
|
|
external class A {
|
|
@nativeGetter
|
|
fun get(a: String): Any? = null
|
|
|
|
@nativeGetter
|
|
fun take(a: Number): String? = null
|
|
|
|
@nativeGetter
|
|
fun foo(a: Double): String? = null
|
|
|
|
companion object {
|
|
@nativeGetter
|
|
fun get(a: String): Any? = null
|
|
|
|
@nativeGetter
|
|
fun take(a: Number): String? = null
|
|
|
|
@nativeGetter
|
|
fun foo(a: Double): String? = null
|
|
}
|
|
}
|
|
|
|
external class B {
|
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
|
val foo = 0
|
|
|
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
|
object Obj1 {}
|
|
|
|
companion object {
|
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
|
val foo = 0
|
|
|
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
|
object Obj2 {}
|
|
}
|
|
}
|
|
|
|
external class C {
|
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
|
fun get(): Any?<!> = null
|
|
|
|
@nativeGetter
|
|
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = null
|
|
|
|
@nativeGetter
|
|
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) {}
|
|
|
|
@nativeGetter
|
|
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = 0
|
|
|
|
@nativeGetter
|
|
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = "foo"<!>): Int? = 0
|
|
|
|
} |