Update tests on decompiled text for JS

Because .kjsm files now contain all declarations from the package (contrary to
the JVM decompiler which produces one file for one class/package facade), some
common decompiled text tests started to behave differently on JVM and JS.
Update two of them (Modifiers, ClassWithClassObject) to make results the same,
copy another (TypeAliases) to JVM-/JS-specific tests with different outputs
This commit is contained in:
Alexander Udalov
2017-01-25 16:46:56 +03:00
parent 805e3e4d0f
commit b5fef84e9c
17 changed files with 108 additions and 31 deletions
@@ -5,9 +5,9 @@ package test
public final class ClassWithClassObject public constructor() {
public companion object {
public final val a: test.A /* compiled code */
public final val a: test.ClassWithClassObject.A /* compiled code */
public final var b: test.B /* compiled code */
public final var b: test.ClassWithClassObject.B /* compiled code */
public final val kotlin.Int.g: kotlin.Int /* compiled code */
@@ -21,4 +21,10 @@ public final class ClassWithClassObject public constructor() {
}
public final fun f(): kotlin.Unit { /* compiled code */ }
public final class A public constructor() {
}
public final class B public constructor() {
}
}
@@ -25,10 +25,10 @@ class ClassWithClassObject {
throw RuntimeException()
}
}
}
class B {
}
class B {
}
class A {
class A {
}
}
@@ -11,4 +11,7 @@ public final data class Modifiers public constructor(x: kotlin.Int) {
public final inline fun inlined(crossinline arg1: () -> kotlin.Unit, noinline arg2: () -> kotlin.Unit): kotlin.Unit { /* compiled code */ }
public final tailrec fun sum(x: kotlin.Long, sum: kotlin.Long): kotlin.Long { /* compiled code */ }
public final annotation class Ann public constructor() : kotlin.Annotation {
}
}
@@ -7,6 +7,6 @@ data class Modifiers(val x: Int) {
}
inline fun inlined(crossinline arg1: ()->Unit, noinline arg2: ()->Unit): Unit {}
}
annotation class Ann
annotation class Ann
}
@@ -1,13 +0,0 @@
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package test
public final class TypeAliases public constructor() {
public final fun foo(a: dependency.A /* = () -> kotlin.Unit */, b: test.TypeAliases.B /* = (dependency.A /* = () -> kotlin.Unit */) -> kotlin.Unit */, ta: test.Outer<kotlin.String, kotlin.Double>.Inner<kotlin.Int>.TA<kotlin.Boolean> /* = kotlin.collections.Map<kotlin.collections.Map<kotlin.String, kotlin.Double>, kotlin.collections.Map<kotlin.Int, kotlin.Boolean>> */): kotlin.Unit { /* compiled code */ }
@kotlin.Suppress public typealias B = (dependency.A) -> kotlin.Unit
@test.Ann @kotlin.Suppress private typealias Parametrized<E, F> = kotlin.collections.Map<E, F>
}
@@ -1,7 +0,0 @@
package dependency
typealias A = () -> Unit
fun foo(a: A) {
a.invoke()
}
@@ -1,28 +0,0 @@
package test
import dependency.*
import kotlin.annotation.AnnotationTarget
class Outer<E, F> {
inner class Inner<G> {
@Suppress("TOPLEVEL_TYPEALIASES_ONLY")
typealias TA<H> = Map<Map<E, F>, Map<G, H>>
}
}
@Target(AnnotationTarget.TYPEALIAS)
annotation class Ann(val value: String)
class TypeAliases {
@Suppress("TOPLEVEL_TYPEALIASES_ONLY")
typealias B = (A) -> Unit
fun foo(a: A, b: B, ta: Outer<String, Double>.Inner<Int>.TA<Boolean>) {
b.invoke(a)
}
@Ann("OK")
@Suppress("TOPLEVEL_TYPEALIASES_ONLY")
private typealias Parametrized<E, F> = Map<E, F>
}