From 7ba0dda29c27c4ae5ada543a72a29ea4588968bb Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 29 May 2015 19:16:29 +0300 Subject: [PATCH] Check compileJavaAgainstKotlin tests with .txt files --- .../class/ClassObject.txt | 33 +++++++++++ .../class/DefaultConstructor.txt | 11 ++++ .../class/DefaultConstructorWithTwoArgs.txt | 12 ++++ .../class/ExtendsAbstractListT.txt | 36 ++++++++++++ .../class/ImplementsListString.txt | 32 +++++++++++ .../class/ImplementsMapPP.txt | 21 +++++++ .../class/InnerClass.txt | 19 +++++++ .../class/InnerClassConstructors.txt | 20 +++++++ .../class/InnerClassOfGeneric.txt | 20 +++++++ .../compileJavaAgainstKotlin/class/Simple.txt | 9 +++ .../class/StarProjection.txt | 20 +++++++ .../compileJavaAgainstKotlin/class/kt3561.txt | 24 ++++++++ .../compileJavaAgainstKotlin/class/kt4050.txt | 30 ++++++++++ .../method/AccessorGenericSignature.txt | 13 +++++ .../compileJavaAgainstKotlin/method/Any.txt | 7 +++ .../method/ArrayOfIntArray.txt | 7 +++ .../method/ArrayOfIntegerArray.txt | 7 +++ .../ClashingSignaturesWithoutReturnType.txt | 12 ++++ .../method/Delegation.txt | 25 +++++++++ .../method/Extensions.txt | 8 +++ .../method/GenericArray.txt | 10 ++++ .../compileJavaAgainstKotlin/method/Hello.txt | 10 ++++ .../compileJavaAgainstKotlin/method/Int.txt | 7 +++ .../method/IntArray.txt | 7 +++ .../method/IntWithDefault.txt | 7 +++ .../method/IntegerArray.txt | 7 +++ .../method/ListOfInt.txt | 10 ++++ .../method/ListOfString.txt | 10 ++++ .../method/ListOfT.txt | 10 ++++ .../method/MapOfKString.txt | 10 ++++ .../method/MapOfStringIntQ.txt | 10 ++++ .../method/QExtendsListString.txt | 10 ++++ .../method/QExtendsString.txt | 10 ++++ .../method/TraitImpl.txt | 12 ++++ .../method/Vararg.txt | 7 +++ .../compileJavaAgainstKotlin/method/Void.txt | 7 +++ .../method/platformName/PlatformName.txt | 10 ++++ .../primitiveOverride/ByteOverridesObject.txt | 27 +++++++++ .../CallFinalNotInSubclass.txt | 15 +++++ .../primitiveOverride/CallNotInSubclass.txt | 15 +++++ .../CovariantReturnTypeOverride.txt | 16 ++++++ .../primitiveOverride/FinalOverride.txt | 16 ++++++ .../IntOverridesComparable.txt | 27 +++++++++ .../primitiveOverride/IntOverridesNumber.txt | 27 +++++++++ .../primitiveOverride/IntOverridesObject.txt | 27 +++++++++ .../ManyClassesHierarchy.txt | 25 +++++++++ .../NullableIntOverridesObject.txt | 27 +++++++++ .../primitiveOverride/OverrideInJava.txt | 16 ++++++ .../method/throws/ClassMembers.txt | 27 +++++++++ .../method/throws/Constructor.txt | 36 ++++++++++++ .../method/throws/DefaultArgs.txt | 20 +++++++ .../method/throws/Delegation.txt | 40 ++++++++++++++ .../method/throws/GenericSubstitution.txt | 24 ++++++++ .../method/throws/TopLevel.txt | 24 ++++++++ .../method/throws/TraitMembers.txt | 33 +++++++++++ .../platformStatic/simpleClassObject.txt | 23 ++++++++ .../simpleClassObjectProperty.txt | 20 +++++++ .../platformStatic/simpleObject.txt | 19 +++++++ .../platformStatic/simpleObjectProperty.txt | 16 ++++++ .../property/Extensions.txt | 8 +++ .../property/GenericProperty.txt | 8 +++ .../property/platformName/PlatformName.txt | 10 ++++ .../staticFields/AnnotationClass.txt | 55 +++++++++++++++++++ .../staticFields/AnnotationTrait.txt | 54 ++++++++++++++++++ .../staticFields/kt3698.txt | 23 ++++++++ .../staticFields/staticClassProperty.txt | 18 ++++++ .../staticFields/staticTraitProperty.txt | 16 ++++++ .../AbstractCompileJavaAgainstKotlinTest.java | 43 ++++++++++++++- 68 files changed, 1272 insertions(+), 3 deletions(-) create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/ClassObject.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructor.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructorWithTwoArgs.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/ExtendsAbstractListT.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/ImplementsListString.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/InnerClass.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/InnerClassConstructors.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/InnerClassOfGeneric.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/Simple.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/StarProjection.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/kt3561.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/class/kt4050.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/AccessorGenericSignature.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Any.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntArray.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Delegation.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Extensions.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/GenericArray.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Hello.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Int.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/IntArray.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/IntWithDefault.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/IntegerArray.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ListOfInt.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ListOfString.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/ListOfT.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/MapOfKString.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/MapOfStringIntQ.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/QExtendsListString.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/QExtendsString.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/TraitImpl.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Vararg.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/Void.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/platformName/PlatformName.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ByteOverridesObject.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallFinalNotInSubclass.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallNotInSubclass.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CovariantReturnTypeOverride.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/FinalOverride.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesComparable.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesNumber.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesObject.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ManyClassesHierarchy.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/NullableIntOverridesObject.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/OverrideInJava.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/property/Extensions.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationClass.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/staticFields/kt3698.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.txt create mode 100644 compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.txt diff --git a/compiler/testData/compileJavaAgainstKotlin/class/ClassObject.txt b/compiler/testData/compileJavaAgainstKotlin/class/ClassObject.txt new file mode 100644 index 00000000000..e239763a74f --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/ClassObject.txt @@ -0,0 +1,33 @@ +package test + +public/*package*/ open class ClassObject { + public/*package*/ constructor ClassObject() + public/*package*/ open fun accessToClassObject(): kotlin.Unit + public/*package*/ open fun accessToInnerClass(): kotlin.Unit + public/*package*/ open fun accessToPackageObject(): kotlin.Unit +} + +internal object PackageInner { + private constructor PackageInner() + internal final val value: kotlin.Int + internal final fun foo(): kotlin.Unit +} + +internal final class WithClassObject { + public constructor WithClassObject() + + internal companion object Companion { + private constructor Companion() + internal final val value: kotlin.Int + internal final val valueWithGetter: kotlin.Int + internal final var variable: kotlin.Int + internal final var variableWithAccessors: kotlin.Int + internal final fun foo(): kotlin.Unit + } + + internal final class MyInner { + public constructor MyInner() + internal final val value: kotlin.Int + internal final fun foo(): kotlin.Unit + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructor.txt b/compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructor.txt new file mode 100644 index 00000000000..c78c101af85 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructor.txt @@ -0,0 +1,11 @@ +package test + +internal final class A { + public constructor A(/*0*/ kotlin.Int = ...) + internal final val a: kotlin.Int +} + +public/*package*/ open class Simple { + public/*package*/ constructor Simple() + public/*package*/ open fun foo(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructorWithTwoArgs.txt b/compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructorWithTwoArgs.txt new file mode 100644 index 00000000000..22ca9ea10ec --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/DefaultConstructorWithTwoArgs.txt @@ -0,0 +1,12 @@ +package test + +internal final class A { + public constructor A(/*0*/ kotlin.Int = ..., /*1*/ kotlin.String = ...) + internal final val a: kotlin.Int + internal final val b: kotlin.String +} + +public/*package*/ open class Simple { + public/*package*/ constructor Simple() + public/*package*/ open fun foo(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/ExtendsAbstractListT.txt b/compiler/testData/compileJavaAgainstKotlin/class/ExtendsAbstractListT.txt new file mode 100644 index 00000000000..3d18e1b2dff --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/ExtendsAbstractListT.txt @@ -0,0 +1,36 @@ +package test + +public/*package*/ open class ExtendsAbstractListT { + public/*package*/ constructor ExtendsAbstractListT() +} + +internal abstract class Mine : java.util.AbstractList { + public constructor Mine() + protected/*protected and package*/ final /*fake_override*/ var modCount: kotlin.Int + public open /*fake_override*/ fun add(/*0*/ T!): kotlin.Boolean + public open /*fake_override*/ fun add(/*0*/ kotlin.Int, /*1*/ T!): kotlin.Unit + public open /*fake_override*/ fun addAll(/*0*/ kotlin.Collection): kotlin.Boolean + public open /*fake_override*/ fun addAll(/*0*/ kotlin.Int, /*1*/ (kotlin.MutableCollection..kotlin.Collection?)): kotlin.Boolean + public open /*fake_override*/ fun clear(): kotlin.Unit + public open /*fake_override*/ fun contains(/*0*/ kotlin.Any?): kotlin.Boolean + public open /*fake_override*/ fun containsAll(/*0*/ kotlin.Collection): kotlin.Boolean + public abstract /*fake_override*/ fun get(/*0*/ kotlin.Int): T! + public open /*fake_override*/ fun indexOf(/*0*/ kotlin.Any!): kotlin.Int + public open /*fake_override*/ fun isEmpty(): kotlin.Boolean + public open /*fake_override*/ fun iterator(): kotlin.(Mutable)Iterator! + public open /*fake_override*/ fun lastIndexOf(/*0*/ kotlin.Any!): kotlin.Int + public open /*fake_override*/ fun listIterator(): kotlin.(Mutable)ListIterator! + public open /*fake_override*/ fun listIterator(/*0*/ kotlin.Int): kotlin.(Mutable)ListIterator! + invisible_fake open /*fake_override*/ fun outOfBoundsMsg(/*0*/ kotlin.Int): kotlin.String! + invisible_fake open /*fake_override*/ fun rangeCheckForAdd(/*0*/ kotlin.Int): kotlin.Unit + public open /*fake_override*/ fun remove(/*0*/ kotlin.Any?): kotlin.Boolean + public open /*fake_override*/ fun remove(/*0*/ kotlin.Int): T! + public open /*fake_override*/ fun removeAll(/*0*/ kotlin.Collection): kotlin.Boolean + protected/*protected and package*/ open /*fake_override*/ fun removeRange(/*0*/ kotlin.Int, /*1*/ kotlin.Int): kotlin.Unit + public open /*fake_override*/ fun retainAll(/*0*/ kotlin.Collection): kotlin.Boolean + public open /*fake_override*/ fun set(/*0*/ kotlin.Int, /*1*/ T!): T! + public abstract /*fake_override*/ fun size(): kotlin.Int + public open /*fake_override*/ fun subList(/*0*/ kotlin.Int, /*1*/ kotlin.Int): kotlin.(Mutable)List! + public open /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>! + public open /*fake_override*/ fun toArray(/*0*/ kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>! +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/ImplementsListString.txt b/compiler/testData/compileJavaAgainstKotlin/class/ImplementsListString.txt new file mode 100644 index 00000000000..4c097c488c3 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/ImplementsListString.txt @@ -0,0 +1,32 @@ +package test + +internal abstract class Mine : java.util.List { + public constructor Mine() + public abstract /*fake_override*/ fun add(/*0*/ kotlin.Int, /*1*/ kotlin.String!): kotlin.Unit + public abstract /*fake_override*/ fun add(/*0*/ kotlin.String!): kotlin.Boolean + public abstract /*fake_override*/ fun addAll(/*0*/ (kotlin.MutableCollection..kotlin.Collection?)): kotlin.Boolean + public abstract /*fake_override*/ fun addAll(/*0*/ kotlin.Int, /*1*/ (kotlin.MutableCollection..kotlin.Collection?)): kotlin.Boolean + public abstract /*fake_override*/ fun clear(): kotlin.Unit + public abstract /*fake_override*/ fun contains(/*0*/ kotlin.Any!): kotlin.Boolean + public abstract /*fake_override*/ fun containsAll(/*0*/ kotlin.(Mutable)Collection<*>!): kotlin.Boolean + public abstract /*fake_override*/ fun get(/*0*/ kotlin.Int): kotlin.String! + public abstract /*fake_override*/ fun indexOf(/*0*/ kotlin.Any!): kotlin.Int + public abstract /*fake_override*/ fun isEmpty(): kotlin.Boolean + public abstract /*fake_override*/ fun iterator(): kotlin.(Mutable)Iterator! + public abstract /*fake_override*/ fun lastIndexOf(/*0*/ kotlin.Any!): kotlin.Int + public abstract /*fake_override*/ fun listIterator(): kotlin.(Mutable)ListIterator! + public abstract /*fake_override*/ fun listIterator(/*0*/ kotlin.Int): kotlin.(Mutable)ListIterator! + public abstract /*fake_override*/ fun remove(/*0*/ kotlin.Any!): kotlin.Boolean + public abstract /*fake_override*/ fun remove(/*0*/ kotlin.Int): kotlin.String! + public abstract /*fake_override*/ fun removeAll(/*0*/ kotlin.(Mutable)Collection<*>!): kotlin.Boolean + public abstract /*fake_override*/ fun retainAll(/*0*/ kotlin.(Mutable)Collection<*>!): kotlin.Boolean + public abstract /*fake_override*/ fun set(/*0*/ kotlin.Int, /*1*/ kotlin.String!): kotlin.String! + public abstract /*fake_override*/ fun size(): kotlin.Int + public abstract /*fake_override*/ fun subList(/*0*/ kotlin.Int, /*1*/ kotlin.Int): kotlin.(Mutable)List! + public abstract /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>! + public abstract /*fake_override*/ fun toArray(/*0*/ kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>! +} + +public/*package*/ open class PlainExtendsListString { + public/*package*/ constructor PlainExtendsListString() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.txt b/compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.txt new file mode 100644 index 00000000000..a871f84f3d6 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.txt @@ -0,0 +1,21 @@ +package test + +public/*package*/ open class ImplementsMapPP { + public/*package*/ constructor ImplementsMapPP() +} + +internal abstract class Mine : java.util.Map { + public constructor Mine() + public abstract /*fake_override*/ fun clear(): kotlin.Unit + public abstract /*fake_override*/ fun containsKey(/*0*/ kotlin.Any!): kotlin.Boolean + public abstract /*fake_override*/ fun containsValue(/*0*/ kotlin.Any!): kotlin.Boolean + public abstract /*fake_override*/ fun entrySet(): kotlin.(Mutable)Set!>! + public abstract /*fake_override*/ fun get(/*0*/ kotlin.Any!): P1! + public abstract /*fake_override*/ fun isEmpty(): kotlin.Boolean + public abstract /*fake_override*/ fun keySet(): kotlin.(Mutable)Set! + public abstract /*fake_override*/ fun put(/*0*/ P2!, /*1*/ P1!): P1! + public abstract /*fake_override*/ fun putAll(/*0*/ (kotlin.MutableMap..kotlin.Map?)): kotlin.Unit + public abstract /*fake_override*/ fun remove(/*0*/ kotlin.Any!): P1! + public abstract /*fake_override*/ fun size(): kotlin.Int + public abstract /*fake_override*/ fun values(): kotlin.(Mutable)Collection! +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/InnerClass.txt b/compiler/testData/compileJavaAgainstKotlin/class/InnerClass.txt new file mode 100644 index 00000000000..e448c99e340 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/InnerClass.txt @@ -0,0 +1,19 @@ +package test + +public/*package*/ open class InnerClass { + public/*package*/ constructor InnerClass() + public/*package*/ final var field1: test.Outer.Inner1! + public/*package*/ final var field2: test.Outer.Inner2! +} + +internal final class Outer { + public constructor Outer() + + internal final inner class Inner1 { + public constructor Inner1() + } + + internal final inner class Inner2 { + public constructor Inner2(/*0*/ kotlin.String) + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/InnerClassConstructors.txt b/compiler/testData/compileJavaAgainstKotlin/class/InnerClassConstructors.txt new file mode 100644 index 00000000000..14188259edc --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/InnerClassConstructors.txt @@ -0,0 +1,20 @@ +package test + +public/*package*/ open class InnerClassConstructors { + public/*package*/ constructor InnerClassConstructors() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} + +internal final class Outer { + public constructor Outer() + + internal final inner class InnerGeneric { + public constructor InnerGeneric(/*0*/ kotlin.List) + } + + internal final inner class InnerPrimitive { + public constructor InnerPrimitive(/*0*/ kotlin.Int) + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/InnerClassOfGeneric.txt b/compiler/testData/compileJavaAgainstKotlin/class/InnerClassOfGeneric.txt new file mode 100644 index 00000000000..7c0f5558671 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/InnerClassOfGeneric.txt @@ -0,0 +1,20 @@ +package test + +public/*package*/ open class InnerClassOfGeneric { + public/*package*/ constructor InnerClassOfGeneric() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} + +internal final class Outer { + public constructor Outer() + + internal final inner class Inner { + public constructor Inner(/*0*/ kotlin.List) + } + + internal final inner class InnerSimple { + public constructor InnerSimple() + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/Simple.txt b/compiler/testData/compileJavaAgainstKotlin/class/Simple.txt new file mode 100644 index 00000000000..ddda4234c09 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/Simple.txt @@ -0,0 +1,9 @@ +package test + +internal final class Impossible { + public constructor Impossible() +} + +public/*package*/ open class Simple { + public/*package*/ constructor Simple() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/StarProjection.txt b/compiler/testData/compileJavaAgainstKotlin/class/StarProjection.txt new file mode 100644 index 00000000000..f0ce369c3eb --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/StarProjection.txt @@ -0,0 +1,20 @@ +package test + +internal fun bar(/*0*/ test.K<*>): kotlin.Unit + +internal open class K> { + public constructor K>() + internal final fun foo(): test.K<*> + internal final fun foo(/*0*/ test.K<*>): kotlin.Unit +} + +public open class StarProjection { + public constructor StarProjection() + public/*package*/ open fun foo(/*0*/ test.K<*>!): kotlin.Unit +} + +internal final class Sub : test.K> { + public constructor Sub() + internal final /*fake_override*/ fun foo(): test.K<*> + internal final /*fake_override*/ fun foo(/*0*/ test.K<*>): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/kt3561.txt b/compiler/testData/compileJavaAgainstKotlin/class/kt3561.txt new file mode 100644 index 00000000000..e19de802198 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/kt3561.txt @@ -0,0 +1,24 @@ +package test + +internal final enum class MyEnum : kotlin.Enum { + public enum entry OK : test.MyEnum { + private constructor OK() + public final /*fake_override*/ fun compareTo(/*0*/ test.MyEnum): kotlin.Int + public final /*fake_override*/ fun name(): kotlin.String + public final /*fake_override*/ fun ordinal(): kotlin.Int + } + + private constructor MyEnum() + public final /*fake_override*/ fun compareTo(/*0*/ test.MyEnum): kotlin.Int + public final /*fake_override*/ fun name(): kotlin.String + public final /*fake_override*/ fun ordinal(): kotlin.Int + + // Static members + public final /*synthesized*/ fun valueOf(/*0*/ kotlin.String): test.MyEnum + public final /*synthesized*/ fun values(): kotlin.Array +} + +public open class kt3561 { + public constructor kt3561() + public open fun getEntryName(): test.MyEnum! +} diff --git a/compiler/testData/compileJavaAgainstKotlin/class/kt4050.txt b/compiler/testData/compileJavaAgainstKotlin/class/kt4050.txt new file mode 100644 index 00000000000..04bbc9b07a9 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/class/kt4050.txt @@ -0,0 +1,30 @@ +package test + +internal final enum class MyEnum : kotlin.Enum { + public enum entry ENTRY : test.MyEnum { + private constructor ENTRY() + kotlin.deprecated(value = "": kotlin.String) internal final /*fake_override*/ val ord: kotlin.Int + public final /*fake_override*/ fun compareTo(/*0*/ test.MyEnum): kotlin.Int + internal final /*fake_override*/ fun f(/*0*/ java.lang.Deprecated() kotlin.Int): kotlin.Unit + public final /*fake_override*/ fun name(): kotlin.String + public final /*fake_override*/ fun ordinal(): kotlin.Int + } + + private constructor MyEnum(/*0*/ kotlin.deprecated(value = "": kotlin.String) kotlin.Int) + kotlin.deprecated(value = "": kotlin.String) internal final val ord: kotlin.Int + public final /*fake_override*/ fun compareTo(/*0*/ test.MyEnum): kotlin.Int + internal final fun f(/*0*/ java.lang.Deprecated() kotlin.Int): kotlin.Unit + public final /*fake_override*/ fun name(): kotlin.String + public final /*fake_override*/ fun ordinal(): kotlin.Int + + // Static members + public final /*synthesized*/ fun valueOf(/*0*/ kotlin.String): test.MyEnum + public final /*synthesized*/ fun values(): kotlin.Array +} + +public open class kt4050 { + public constructor kt4050() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/AccessorGenericSignature.txt b/compiler/testData/compileJavaAgainstKotlin/method/AccessorGenericSignature.txt new file mode 100644 index 00000000000..ba8723abf76 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/AccessorGenericSignature.txt @@ -0,0 +1,13 @@ +package test + +public open class AccessorGenericSignature { + public constructor AccessorGenericSignature() + private final val b: test.BadClass! +} + +public final class BadClass { + public constructor BadClass() + private final fun bar(/*0*/ kotlin.List): kotlin.Unit + private final fun > baz(/*0*/ kotlin.List): kotlin.Unit + internal final fun foo(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Any.txt b/compiler/testData/compileJavaAgainstKotlin/method/Any.txt new file mode 100644 index 00000000000..a3ef6836020 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Any.txt @@ -0,0 +1,7 @@ +package test + +internal fun anyany(/*0*/ kotlin.Any, /*1*/ java.util.List): kotlin.Any + +public/*package*/ open class Any { + public/*package*/ constructor Any() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntArray.txt b/compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntArray.txt new file mode 100644 index 00000000000..bc4e67fc1ab --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntArray.txt @@ -0,0 +1,7 @@ +package test + +internal fun ohMy(/*0*/ kotlin.Array): kotlin.Array + +public/*package*/ open class ArrayOfIntArray { + public/*package*/ constructor ArrayOfIntArray() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.txt b/compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.txt new file mode 100644 index 00000000000..2222cc9a61e --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ArrayOfIntegerArray.txt @@ -0,0 +1,7 @@ +package test + +internal fun ohMy(/*0*/ kotlin.Array>, /*1*/ java.util.List): kotlin.Array> + +public/*package*/ open class ArrayOfIntArray { + public/*package*/ constructor ArrayOfIntArray() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.txt b/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.txt new file mode 100644 index 00000000000..73e94f8cf80 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ClashingSignaturesWithoutReturnType.txt @@ -0,0 +1,12 @@ +package test + +public open class ClashingSignaturesWithoutReturnType { + public constructor ClashingSignaturesWithoutReturnType() + public/*package*/ open fun test(/*0*/ kotlin.(Mutable)List!, /*1*/ kotlin.(Mutable)List!): kotlin.Unit +} + +internal final class K { + public constructor K() + internal final fun foo(/*0*/ kotlin.List): kotlin.Int + internal final fun foo(/*0*/ kotlin.List): kotlin.String +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Delegation.txt b/compiler/testData/compileJavaAgainstKotlin/method/Delegation.txt new file mode 100644 index 00000000000..bb28287c7eb --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Delegation.txt @@ -0,0 +1,25 @@ +package test + +internal final class Impl : test.Trait { + public constructor Impl() + internal open val bar: kotlin.Int + internal open fun foo(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} + +internal final class Test : test.Trait { + public constructor Test() + internal open /*delegation*/ val bar: kotlin.Int + internal open /*delegation*/ fun foo(): kotlin.Unit +} + +internal interface Trait { + internal abstract val bar: kotlin.Int + internal abstract fun foo(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Extensions.txt b/compiler/testData/compileJavaAgainstKotlin/method/Extensions.txt new file mode 100644 index 00000000000..a4cb5287544 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Extensions.txt @@ -0,0 +1,8 @@ +package test + +internal fun kotlin.String.noParam(): kotlin.Unit +internal fun kotlin.String.param(/*0*/ kotlin.String): kotlin.Unit + +public/*package*/ open class GenericArray { + public/*package*/ constructor GenericArray() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/GenericArray.txt b/compiler/testData/compileJavaAgainstKotlin/method/GenericArray.txt new file mode 100644 index 00000000000..c0e66b27ffe --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/GenericArray.txt @@ -0,0 +1,10 @@ +package test + +internal fun ffgg(/*0*/ kotlin.Array

): kotlin.Array

+ +public/*package*/ open class GenericArray { + public/*package*/ constructor GenericArray() + + // Static members + public open fun ggff(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Hello.txt b/compiler/testData/compileJavaAgainstKotlin/method/Hello.txt new file mode 100644 index 00000000000..955cf9af8a2 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Hello.txt @@ -0,0 +1,10 @@ +package test + +internal fun f(): kotlin.String + +public/*package*/ open class Hello { + public/*package*/ constructor Hello() + + // Static members + public open fun xx(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Int.txt b/compiler/testData/compileJavaAgainstKotlin/method/Int.txt new file mode 100644 index 00000000000..99872697633 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Int.txt @@ -0,0 +1,7 @@ +package test + +internal fun lll(/*0*/ kotlin.Int): kotlin.Int + +public/*package*/ open class Int { + public/*package*/ constructor Int() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/IntArray.txt b/compiler/testData/compileJavaAgainstKotlin/method/IntArray.txt new file mode 100644 index 00000000000..7e3a7af7adb --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/IntArray.txt @@ -0,0 +1,7 @@ +package test + +internal fun doNothing(/*0*/ kotlin.IntArray, /*1*/ java.util.List): kotlin.IntArray + +public/*package*/ open class IntArray { + public/*package*/ constructor IntArray() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/IntWithDefault.txt b/compiler/testData/compileJavaAgainstKotlin/method/IntWithDefault.txt new file mode 100644 index 00000000000..aee2606df17 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/IntWithDefault.txt @@ -0,0 +1,7 @@ +package test + +internal fun www(/*0*/ kotlin.Int = ...): kotlin.Int + +public/*package*/ open class IntWithDefault { + public/*package*/ constructor IntWithDefault() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/IntegerArray.txt b/compiler/testData/compileJavaAgainstKotlin/method/IntegerArray.txt new file mode 100644 index 00000000000..ed12e37ccf4 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/IntegerArray.txt @@ -0,0 +1,7 @@ +package test + +internal fun doNothing(/*0*/ kotlin.Array, /*1*/ java.util.List): kotlin.Array + +public/*package*/ open class IntArray { + public/*package*/ constructor IntArray() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ListOfInt.txt b/compiler/testData/compileJavaAgainstKotlin/method/ListOfInt.txt new file mode 100644 index 00000000000..7101265c8a8 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ListOfInt.txt @@ -0,0 +1,10 @@ +package test + +internal fun ggg(/*0*/ kotlin.List): kotlin.List + +public/*package*/ open class ListOfInt { + public/*package*/ constructor ListOfInt() + + // Static members + public open fun hhh(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ListOfString.txt b/compiler/testData/compileJavaAgainstKotlin/method/ListOfString.txt new file mode 100644 index 00000000000..7200f1079ad --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ListOfString.txt @@ -0,0 +1,10 @@ +package test + +internal fun ff(/*0*/ kotlin.List): kotlin.Int + +public/*package*/ open class ListString { + public/*package*/ constructor ListString() + + // Static members + public open fun gg(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/ListOfT.txt b/compiler/testData/compileJavaAgainstKotlin/method/ListOfT.txt new file mode 100644 index 00000000000..cebae00646d --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/ListOfT.txt @@ -0,0 +1,10 @@ +package test + +internal fun listOfT(/*0*/ kotlin.List

): kotlin.List

+ +public/*package*/ open class ListOfT { + public/*package*/ constructor ListOfT() + + // Static members + public open fun check(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/MapOfKString.txt b/compiler/testData/compileJavaAgainstKotlin/method/MapOfKString.txt new file mode 100644 index 00000000000..c61ba0b352c --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/MapOfKString.txt @@ -0,0 +1,10 @@ +package test + +internal fun fff(/*0*/ kotlin.Map): kotlin.Map + +public/*package*/ open class MapOfKString { + public/*package*/ constructor MapOfKString() + + // Static members + public open fun gfgdgfg(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/MapOfStringIntQ.txt b/compiler/testData/compileJavaAgainstKotlin/method/MapOfStringIntQ.txt new file mode 100644 index 00000000000..0e83dbe176b --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/MapOfStringIntQ.txt @@ -0,0 +1,10 @@ +package test + +internal fun fff(/*0*/ kotlin.Map): kotlin.Map + +public/*package*/ open class MapOfKString { + public/*package*/ constructor MapOfKString() + + // Static members + public open fun gfgdgfg(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/QExtendsListString.txt b/compiler/testData/compileJavaAgainstKotlin/method/QExtendsListString.txt new file mode 100644 index 00000000000..6e83706267f --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/QExtendsListString.txt @@ -0,0 +1,10 @@ +package test + +internal fun > id(/*0*/ P1): P1 + +public/*package*/ open class Question { + public/*package*/ constructor Question() + + // Static members + public/*package*/ open fun id2(/*0*/ T!): T! +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/QExtendsString.txt b/compiler/testData/compileJavaAgainstKotlin/method/QExtendsString.txt new file mode 100644 index 00000000000..6701e011aef --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/QExtendsString.txt @@ -0,0 +1,10 @@ +package test + +internal fun id(/*0*/ T): T + +public/*package*/ open class Question { + public/*package*/ constructor Question() + + // Static members + public/*package*/ open fun id2(/*0*/ T!): T! +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/TraitImpl.txt b/compiler/testData/compileJavaAgainstKotlin/method/TraitImpl.txt new file mode 100644 index 00000000000..03997ba5129 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/TraitImpl.txt @@ -0,0 +1,12 @@ +package test + +internal interface Trait { + internal open fun generic(/*0*/ kotlin.List): kotlin.Unit + internal open fun simple(): kotlin.Unit +} + +public/*package*/ abstract class TraitImpl : test.Trait { + public/*package*/ constructor TraitImpl() + internal open /*fake_override*/ fun generic(/*0*/ kotlin.List): kotlin.Unit + internal open /*fake_override*/ fun simple(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Vararg.txt b/compiler/testData/compileJavaAgainstKotlin/method/Vararg.txt new file mode 100644 index 00000000000..bbfa1483ab3 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Vararg.txt @@ -0,0 +1,7 @@ +package test + +internal fun gg(/*0*/ kotlin.List, /*1*/ vararg kotlin.Int /*kotlin.IntArray*/): kotlin.List + +public/*package*/ open class Vararg { + public/*package*/ constructor Vararg() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/Void.txt b/compiler/testData/compileJavaAgainstKotlin/method/Void.txt new file mode 100644 index 00000000000..0faa11839b0 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/Void.txt @@ -0,0 +1,7 @@ +package test + +internal fun f(): kotlin.Unit + +public/*package*/ open class Void { + public/*package*/ constructor Void() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/platformName/PlatformName.txt b/compiler/testData/compileJavaAgainstKotlin/method/platformName/PlatformName.txt new file mode 100644 index 00000000000..107e66d6b58 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/platformName/PlatformName.txt @@ -0,0 +1,10 @@ +package test + +kotlin.platform.platformName(name = "bar": kotlin.String) internal fun foo(): kotlin.Unit + +public open class PlatformName { + public constructor PlatformName() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ByteOverridesObject.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ByteOverridesObject.txt new file mode 100644 index 00000000000..001503d8b8d --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ByteOverridesObject.txt @@ -0,0 +1,27 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal open class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Byte +} + +internal abstract class C : test.A { + public constructor C() + internal abstract /*fake_override*/ fun foo(): kotlin.Byte +} + +public/*package*/ open class ExtendsB : test.B { + public/*package*/ constructor ExtendsB() + internal open /*fake_override*/ fun foo(): kotlin.Byte + public/*package*/ open fun test(): kotlin.Unit +} + +public/*package*/ open class ExtendsC : test.C { + public/*package*/ constructor ExtendsC() + public open fun foo(): kotlin.Byte! + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallFinalNotInSubclass.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallFinalNotInSubclass.txt new file mode 100644 index 00000000000..602a12b6a89 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallFinalNotInSubclass.txt @@ -0,0 +1,15 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal final class B : test.A { + public constructor B() + internal final fun foo(): kotlin.Int +} + +public/*package*/ open class Test { + public/*package*/ constructor Test() + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallNotInSubclass.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallNotInSubclass.txt new file mode 100644 index 00000000000..6f4e8cf8d2e --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CallNotInSubclass.txt @@ -0,0 +1,15 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal final class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Int +} + +public/*package*/ open class Test { + public/*package*/ constructor Test() + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CovariantReturnTypeOverride.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CovariantReturnTypeOverride.txt new file mode 100644 index 00000000000..89e7bed8deb --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/CovariantReturnTypeOverride.txt @@ -0,0 +1,16 @@ +package test + +internal interface A { + internal abstract fun foo(): kotlin.Any +} + +internal open class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Int +} + +public/*package*/ open class Test : test.B { + public/*package*/ constructor Test() + internal open /*fake_override*/ fun foo(): kotlin.Int + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/FinalOverride.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/FinalOverride.txt new file mode 100644 index 00000000000..fc485350d3a --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/FinalOverride.txt @@ -0,0 +1,16 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal open class B : test.A { + public constructor B() + internal final fun foo(): kotlin.Int +} + +public/*package*/ open class Test : test.B { + public/*package*/ constructor Test() + internal final /*fake_override*/ fun foo(): kotlin.Int + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesComparable.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesComparable.txt new file mode 100644 index 00000000000..2b3b2080112 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesComparable.txt @@ -0,0 +1,27 @@ +package test + +internal interface A> { + internal abstract fun foo(): T +} + +internal open class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Int +} + +internal abstract class C : test.A { + public constructor C() + internal abstract /*fake_override*/ fun foo(): kotlin.Int +} + +public/*package*/ open class ExtendsB : test.B { + public/*package*/ constructor ExtendsB() + internal open /*fake_override*/ fun foo(): kotlin.Int + public/*package*/ open fun test(): kotlin.Unit +} + +public/*package*/ open class ExtendsC : test.C { + public/*package*/ constructor ExtendsC() + public open fun foo(): kotlin.Int! + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesNumber.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesNumber.txt new file mode 100644 index 00000000000..c2628690147 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesNumber.txt @@ -0,0 +1,27 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal open class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Int +} + +internal abstract class C : test.A { + public constructor C() + internal abstract /*fake_override*/ fun foo(): kotlin.Int +} + +public/*package*/ open class ExtendsB : test.B { + public/*package*/ constructor ExtendsB() + internal open /*fake_override*/ fun foo(): kotlin.Int + public/*package*/ open fun test(): kotlin.Unit +} + +public/*package*/ open class ExtendsC : test.C { + public/*package*/ constructor ExtendsC() + public open fun foo(): kotlin.Int! + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesObject.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesObject.txt new file mode 100644 index 00000000000..961872949bb --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/IntOverridesObject.txt @@ -0,0 +1,27 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal open class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Int +} + +internal abstract class C : test.A { + public constructor C() + internal abstract /*fake_override*/ fun foo(): kotlin.Int +} + +public/*package*/ open class ExtendsB : test.B { + public/*package*/ constructor ExtendsB() + internal open /*fake_override*/ fun foo(): kotlin.Int + public/*package*/ open fun test(): kotlin.Unit +} + +public/*package*/ open class ExtendsC : test.C { + public/*package*/ constructor ExtendsC() + public open fun foo(): kotlin.Int! + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ManyClassesHierarchy.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ManyClassesHierarchy.txt new file mode 100644 index 00000000000..1364ca5b8d8 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/ManyClassesHierarchy.txt @@ -0,0 +1,25 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal interface B : test.A { + internal abstract /*fake_override*/ fun foo(): kotlin.Int +} + +internal abstract class C : test.B { + public constructor C() + internal abstract /*fake_override*/ fun foo(): kotlin.Int +} + +internal open class D : test.C { + public constructor D() + internal open fun foo(): kotlin.Int +} + +public/*package*/ open class ExtendsD : test.D { + public/*package*/ constructor ExtendsD() + internal open /*fake_override*/ fun foo(): kotlin.Int + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/NullableIntOverridesObject.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/NullableIntOverridesObject.txt new file mode 100644 index 00000000000..9411026f19b --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/NullableIntOverridesObject.txt @@ -0,0 +1,27 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal open class B : test.A { + public constructor B() + internal open fun foo(): kotlin.Int? +} + +internal abstract class C : test.A { + public constructor C() + internal abstract /*fake_override*/ fun foo(): kotlin.Int? +} + +public/*package*/ open class ExtendsB : test.B { + public/*package*/ constructor ExtendsB() + internal open /*fake_override*/ fun foo(): kotlin.Int? + public/*package*/ open fun test(): kotlin.Unit +} + +public/*package*/ open class ExtendsC : test.C { + public/*package*/ constructor ExtendsC() + public open fun foo(): kotlin.Int! + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/OverrideInJava.txt b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/OverrideInJava.txt new file mode 100644 index 00000000000..407ad2cb5e4 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/primitiveOverride/OverrideInJava.txt @@ -0,0 +1,16 @@ +package test + +internal interface A { + internal abstract fun foo(): T +} + +internal abstract class B : test.A { + public constructor B() + internal abstract fun foo(): kotlin.Int +} + +public/*package*/ open class ExtendsB : test.B { + public/*package*/ constructor ExtendsB() + public open fun foo(): kotlin.Int! + public/*package*/ open fun test(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.txt new file mode 100644 index 00000000000..d5075f775aa --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.txt @@ -0,0 +1,27 @@ +package test + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +internal final class E2 : java.lang.Exception { + public constructor E2() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + public/*package*/ open fun testMethod(): kotlin.Unit +} + +internal final class Test { + public constructor Test() + internal final fun none(): kotlin.Unit + internal final fun one(): kotlin.Unit + internal final fun two(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.txt new file mode 100644 index 00000000000..89df318073e --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.txt @@ -0,0 +1,36 @@ +package test + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +internal final class E2 : java.lang.Exception { + public constructor E2() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + public/*package*/ open fun testMethod(): kotlin.Unit +} + +internal final class None { + public constructor None() +} + +internal final class One { + public constructor One() +} + +internal final class OneWithParam { + public constructor OneWithParam(/*0*/ kotlin.Int) +} + +internal final class Two { + public constructor Two() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.txt new file mode 100644 index 00000000000..b03b911e2ae --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.txt @@ -0,0 +1,20 @@ +package test + +kotlin.jvm.jvmOverloads() internal fun one(/*0*/ kotlin.Int = ...): kotlin.Unit + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + public/*package*/ open fun testMethod(/*0*/ test.One!): kotlin.Unit +} + +internal final class One { + public constructor One(/*0*/ kotlin.Int = ...) + internal final fun one(/*0*/ kotlin.Int = ...): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.txt new file mode 100644 index 00000000000..1621a4b1170 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.txt @@ -0,0 +1,40 @@ +package test + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +internal final class E2 : java.lang.Exception { + public constructor E2() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +internal final class Impl : test.Trait { + public constructor Impl() + internal open fun none(): kotlin.Unit + internal open fun one(): kotlin.Unit + internal open fun two(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + public/*package*/ open fun testMethod(): kotlin.Unit +} + +internal final class Test : test.Trait { + public constructor Test() + internal open /*delegation*/ fun none(): kotlin.Unit + internal open /*delegation*/ fun one(): kotlin.Unit + internal open /*delegation*/ fun two(): kotlin.Unit +} + +internal interface Trait { + internal abstract fun none(): kotlin.Unit + internal abstract fun one(): kotlin.Unit + internal abstract fun two(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.txt new file mode 100644 index 00000000000..ea8545911e8 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.txt @@ -0,0 +1,24 @@ +package test + +internal interface Base { + internal open fun one(/*0*/ T): kotlin.Unit +} + +internal final class Derived : test.Base { + public constructor Derived() + internal open /*fake_override*/ fun one(/*0*/ kotlin.String): kotlin.Unit +} + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.txt new file mode 100644 index 00000000000..0405ce718f1 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.txt @@ -0,0 +1,24 @@ +package test + +internal fun none(): kotlin.Unit +internal fun one(): kotlin.Unit +internal fun two(): kotlin.Unit + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +internal final class E2 : java.lang.Exception { + public constructor E2() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + public/*package*/ open fun testMethod(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.txt b/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.txt new file mode 100644 index 00000000000..462c82aba1d --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.txt @@ -0,0 +1,33 @@ +package test + +internal final class E1 : java.lang.Exception { + public constructor E1() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +internal final class E2 : java.lang.Exception { + public constructor E2() + public final /*fake_override*/ fun getCause(): kotlin.Throwable? + public final /*fake_override*/ fun getMessage(): kotlin.String? + public final /*fake_override*/ fun printStackTrace(): kotlin.Unit +} + +public/*package*/ open class JavaClass { + public/*package*/ constructor JavaClass() + public/*package*/ open fun testMethod(): kotlin.Unit +} + +internal final class Test : test.Trait { + public constructor Test() + internal open /*fake_override*/ fun none(): kotlin.Unit + internal open /*fake_override*/ fun one(): kotlin.Unit + internal open /*fake_override*/ fun two(): kotlin.Unit +} + +internal interface Trait { + internal open fun none(): kotlin.Unit + internal open fun one(): kotlin.Unit + internal open fun two(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt new file mode 100644 index 00000000000..15a59ed555d --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.txt @@ -0,0 +1,23 @@ +package test + +internal fun main(/*0*/ kotlin.Array): kotlin.Unit + +internal final class A { + public constructor A() + + internal companion object Companion { + private constructor Companion() + internal final val b: kotlin.String + kotlin.platform.platformStatic() internal final fun test1(): kotlin.Unit + kotlin.platform.platformStatic() internal final fun test2(): kotlin.Unit + internal final fun test3(): kotlin.Unit + kotlin.platform.platformStatic() internal final fun kotlin.String.test4(): kotlin.Unit + } +} + +public/*package*/ open class Test { + public/*package*/ constructor Test() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt new file mode 100644 index 00000000000..4ce99eca179 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt @@ -0,0 +1,20 @@ +package test + +internal fun main(/*0*/ kotlin.Array): kotlin.Unit + +internal final class A { + public constructor A() + + internal companion object Companion { + private constructor Companion() + kotlin.platform.platformStatic() internal final val b: kotlin.String + internal final var test.A.c: kotlin.String + } +} + +public/*package*/ open class Test { + public/*package*/ constructor Test() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt new file mode 100644 index 00000000000..526a5e4b56b --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.txt @@ -0,0 +1,19 @@ +package test + +internal fun main(/*0*/ kotlin.Array): kotlin.Unit + +internal object A { + private constructor A() + internal final val b: kotlin.String + kotlin.platform.platformStatic() internal final fun test1(): kotlin.Unit + kotlin.platform.platformStatic() internal final fun test2(): kotlin.Unit + internal final fun test3(): kotlin.Unit + kotlin.platform.platformStatic() internal final fun kotlin.String.test4(): kotlin.Unit +} + +public/*package*/ open class Test { + public/*package*/ constructor Test() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt new file mode 100644 index 00000000000..0f8aa9229f0 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt @@ -0,0 +1,16 @@ +package test + +internal fun main(/*0*/ kotlin.Array): kotlin.Unit + +internal object A { + private constructor A() + kotlin.platform.platformStatic() internal final val b: kotlin.String + internal final var test.A.c: kotlin.String +} + +public/*package*/ open class Test { + public/*package*/ constructor Test() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/property/Extensions.txt b/compiler/testData/compileJavaAgainstKotlin/property/Extensions.txt new file mode 100644 index 00000000000..dab01b9668e --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/property/Extensions.txt @@ -0,0 +1,8 @@ +package test + +internal val kotlin.String.val_: kotlin.String +internal var kotlin.String.var_: kotlin.String + +public/*package*/ open class GenericArray { + public/*package*/ constructor GenericArray() +} diff --git a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt new file mode 100644 index 00000000000..9822e7808e1 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt @@ -0,0 +1,8 @@ +package test + +internal val test: kotlin.Map + +public/*package*/ open class GenericProperty { + public/*package*/ constructor GenericProperty() + public/*package*/ open fun foo(): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.txt b/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.txt new file mode 100644 index 00000000000..77907dbf6c2 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/property/platformName/PlatformName.txt @@ -0,0 +1,10 @@ +package test + +internal var v: kotlin.Int + +public open class PlatformName { + public constructor PlatformName() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationClass.txt b/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationClass.txt new file mode 100644 index 00000000000..bd3168f3c2b --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationClass.txt @@ -0,0 +1,55 @@ +package test + +internal final annotation class AByte : kotlin.Annotation { + public constructor AByte(/*0*/ kotlin.Byte) + internal final val value: kotlin.Byte +} + +internal final annotation class AChar : kotlin.Annotation { + public constructor AChar(/*0*/ kotlin.Char) + internal final val value: kotlin.Char +} + +internal final annotation class ADouble : kotlin.Annotation { + public constructor ADouble(/*0*/ kotlin.Double) + internal final val value: kotlin.Double +} + +internal final annotation class AFloat : kotlin.Annotation { + public constructor AFloat(/*0*/ kotlin.Float) + internal final val value: kotlin.Float +} + +internal final annotation class AInt : kotlin.Annotation { + public constructor AInt(/*0*/ kotlin.Int) + internal final val value: kotlin.Int +} + +internal final annotation class ALong : kotlin.Annotation { + public constructor ALong(/*0*/ kotlin.Long) + internal final val value: kotlin.Long +} + +internal final annotation class AString : kotlin.Annotation { + public constructor AString(/*0*/ kotlin.String) + internal final val value: kotlin.String +} + +test.AString(value = "Test": kotlin.String) test.AChar(value = \u0063 ('c'): kotlin.Char) test.AInt(value = 10: kotlin.Int) test.AByte(value = 11: kotlin.Int) test.ALong(value = 12.toLong(): kotlin.Long) test.ADouble(value = 1.2.toDouble(): kotlin.Double) test.AFloat(value = 1.3.toFloat(): kotlin.Float) public open class AnnotationClass { + public constructor AnnotationClass() +} + +internal final class Test { + public constructor Test() + + internal companion object Companion { + private constructor Companion() + internal final val vbyte: kotlin.Byte + internal final val vchar: kotlin.Char + internal final val vdouble: kotlin.Double + internal final val vfloat: kotlin.Float + internal final val vint: kotlin.Int + internal final val vlong: kotlin.Long + internal final val vstring: kotlin.String + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.txt b/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.txt new file mode 100644 index 00000000000..b2693687450 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/staticFields/AnnotationTrait.txt @@ -0,0 +1,54 @@ +package test + +internal final annotation class AByte : kotlin.Annotation { + public constructor AByte(/*0*/ kotlin.Byte) + internal final val value: kotlin.Byte +} + +internal final annotation class AChar : kotlin.Annotation { + public constructor AChar(/*0*/ kotlin.Char) + internal final val value: kotlin.Char +} + +internal final annotation class ADouble : kotlin.Annotation { + public constructor ADouble(/*0*/ kotlin.Double) + internal final val value: kotlin.Double +} + +internal final annotation class AFloat : kotlin.Annotation { + public constructor AFloat(/*0*/ kotlin.Float) + internal final val value: kotlin.Float +} + +internal final annotation class AInt : kotlin.Annotation { + public constructor AInt(/*0*/ kotlin.Int) + internal final val value: kotlin.Int +} + +internal final annotation class ALong : kotlin.Annotation { + public constructor ALong(/*0*/ kotlin.Long) + internal final val value: kotlin.Long +} + +internal final annotation class AString : kotlin.Annotation { + public constructor AString(/*0*/ kotlin.String) + internal final val value: kotlin.String +} + +test.AString(value = "Test": kotlin.String) test.AChar(value = \u0063 ('c'): kotlin.Char) test.AInt(value = 10: kotlin.Int) test.AByte(value = 11: kotlin.Int) test.ALong(value = 12.toLong(): kotlin.Long) test.ADouble(value = 1.2.toDouble(): kotlin.Double) test.AFloat(value = 1.3.toFloat(): kotlin.Float) public open class AnnotationTrait { + public constructor AnnotationTrait() +} + +internal interface Test { + + internal companion object Companion { + private constructor Companion() + internal final val vbyte: kotlin.Byte + internal final val vchar: kotlin.Char + internal final val vdouble: kotlin.Double + internal final val vfloat: kotlin.Float + internal final val vint: kotlin.Int + internal final val vlong: kotlin.Long + internal final val vstring: kotlin.String + } +} diff --git a/compiler/testData/compileJavaAgainstKotlin/staticFields/kt3698.txt b/compiler/testData/compileJavaAgainstKotlin/staticFields/kt3698.txt new file mode 100644 index 00000000000..33b0f3e0062 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/staticFields/kt3698.txt @@ -0,0 +1,23 @@ +package test + +internal final class KotlinClass { + public constructor KotlinClass() + + internal companion object Companion { + private constructor Companion() + internal final val FOO: kotlin.Int + } +} + +public open class kt3698 { + public constructor kt3698() + + public/*package*/ final annotation class Foo : kotlin.Annotation { + public/*package*/ constructor Foo(/*0*/ kotlin.Int) + public final val value: kotlin.Int + public abstract fun value(): kotlin.Int + } + + // Static members + test.kt3698.Foo(value = 10: kotlin.Int) public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.txt b/compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.txt new file mode 100644 index 00000000000..02209e1a05d --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/staticFields/staticClassProperty.txt @@ -0,0 +1,18 @@ +package test + +internal final class Test { + public constructor Test() + + internal companion object Companion { + private constructor Companion() + public final val valProp: kotlin.Int + public final var varProp: kotlin.Int + } +} + +public/*package*/ open class staticClassProperty { + public/*package*/ constructor staticClassProperty() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.txt b/compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.txt new file mode 100644 index 00000000000..d006602a2b9 --- /dev/null +++ b/compiler/testData/compileJavaAgainstKotlin/staticFields/staticTraitProperty.txt @@ -0,0 +1,16 @@ +package test + +internal interface Test { + + internal companion object Companion { + private constructor Companion() + public final val valProp: kotlin.Int + } +} + +public/*package*/ open class staticTraitProperty { + public/*package*/ constructor staticTraitProperty() + + // Static members + public open fun main(/*0*/ kotlin.Array<(out) kotlin.String!>!): kotlin.Unit +} diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java index 0590681714e..f90c4ed2ed7 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.java @@ -16,21 +16,58 @@ package org.jetbrains.kotlin.jvm.compiler; +import org.jetbrains.kotlin.analyzer.AnalysisResult; +import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles; +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; +import org.jetbrains.kotlin.descriptors.PackageViewDescriptor; +import org.jetbrains.kotlin.psi.JetFile; +import org.jetbrains.kotlin.renderer.DescriptorRenderer; +import org.jetbrains.kotlin.renderer.DescriptorRendererBuilder; +import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil; +import org.jetbrains.kotlin.test.ConfigurationKind; import org.jetbrains.kotlin.test.TestCaseWithTmpdir; +import org.jetbrains.kotlin.test.TestJdkKind; +import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparator; import org.junit.Assert; import java.io.File; import java.io.IOException; import java.util.Collections; -import static org.jetbrains.kotlin.test.JetTestUtils.compileKotlinWithJava; +import static org.jetbrains.kotlin.test.JetTestUtils.*; +import static org.jetbrains.kotlin.test.util.RecursiveDescriptorComparator.DONT_INCLUDE_METHODS_OF_OBJECT; +import static org.jetbrains.kotlin.test.util.RecursiveDescriptorComparator.validateAndCompareDescriptorWithFile; @SuppressWarnings({"JUnitTestCaseWithNonTrivialConstructors", "JUnitTestCaseWithNoTests"}) public abstract class AbstractCompileJavaAgainstKotlinTest extends TestCaseWithTmpdir { + // Do not render parameter names because there are test cases where classes inherit from JDK collections, + // and some versions of JDK have debug information in the class files (including parameter names), and some don't + public static final RecursiveDescriptorComparator.Configuration CONFIGURATION = DONT_INCLUDE_METHODS_OF_OBJECT.withRenderer( + new DescriptorRendererBuilder() + .setWithDefinedIn(false) + .setParameterNameRenderingPolicy(DescriptorRenderer.ParameterNameRenderingPolicy.NONE) + .setVerbose(true) + .build()); + protected void doTest(String ktFilePath) throws IOException { Assert.assertTrue(ktFilePath.endsWith(".kt")); File ktFile = new File(ktFilePath); - File javaFile = new File(ktFilePath.replaceFirst("\\.kt", ".java")); - compileKotlinWithJava(Collections.singletonList(javaFile), Collections.singletonList(ktFile), tmpdir, getTestRootDisposable()); + File javaFile = new File(ktFilePath.replaceFirst("\\.kt$", ".java")); + File expectedFile = new File(ktFilePath.replaceFirst("\\.kt$", ".txt")); + + File out = new File(tmpdir, "out"); + compileKotlinWithJava(Collections.singletonList(javaFile), Collections.singletonList(ktFile), out, getTestRootDisposable()); + + KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForTests( + getTestRootDisposable(), + compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, getAnnotationsJar(), out), + EnvironmentConfigFiles.JVM_CONFIG_FILES + ); + + AnalysisResult exhaust = JvmResolveUtil.analyzeFilesWithJavaIntegration(environment.getProject(), Collections.emptySet()); + PackageViewDescriptor packageView = exhaust.getModuleDescriptor().getPackage(LoadDescriptorUtil.TEST_PACKAGE_FQNAME); + assertNotNull(packageView); + + validateAndCompareDescriptorWithFile(packageView, CONFIGURATION, expectedFile); } }