Support JvmPackageName annotation in JVM back-end

This annotation is currently internal because we only commit to its
support for our own libraries. It will be used to change JVM package
names of declarations in JDK-specific stdlib additions (now called
kotlin-stdlib-jre7/8), both to preserve source compatibility of the old
Kotlin code and to solve the split package problem (KT-19258)
This commit is contained in:
Alexander Udalov
2017-09-05 16:16:36 +03:00
parent 234148518e
commit d07b628e0c
12 changed files with 189 additions and 11 deletions
@@ -0,0 +1,21 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.2
// FILE: 1.kt
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:JvmPackageName("baz.foo.quux.bar")
package foo.bar
fun f(): String = "O"
val g: String? get() = "K"
inline fun <T> i(block: () -> T): T = block()
// FILE: 2.kt
import foo.bar.*
fun box(): String = i { f() + g }