Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmNameOnMangledNames.kt
T
Dmitry Petrov de25359a90 Fix stdlib compilation after updated @JvmName check
Previously, extension receiver type was not taken into account when
checking for @JvmName annotation applicability to possibly mangled
functions (such functions, however, were mangled).
This bug was fixed, but, unfortunately, not before such functions were
added to stdlib ('sumOf' family).
2020-06-04 12:16:28 +03:00

30 lines
694 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class Foo(val x: Int) {
<!INAPPLICABLE_JVM_NAME!>@JvmName("other")<!>
fun simple() {}
}
<!INAPPLICABLE_JVM_NAME!>@JvmName("bad")<!>
fun bar(f: Foo) {}
@JvmName("good")
fun baz(r: Result<Int>) {}
@JvmName("test")
fun returnsInlineClass() = Foo(1)
@JvmName("test")
fun returnsKotlinResult(a: Result<Int>): Result<Int> = a
class C {
<!INAPPLICABLE_JVM_NAME!>@JvmName("test")<!>
fun returnsInlineClass() = Foo(1)
<!INAPPLICABLE_JVM_NAME!>@JvmName("test")<!>
fun returnsKotlinResult(a: Result<Int>): Result<Int> = a
}
<!INAPPLICABLE_JVM_NAME!>@JvmName("extensionFun")<!>
fun Foo.extensionFun() {}