Properly calculate this for super call

This commit is contained in:
Mikhael Bogdanov
2018-04-05 16:44:03 +02:00
parent 0a11385006
commit 942dd8a67c
5 changed files with 227 additions and 7 deletions
+98 -2
View File
@@ -21,8 +21,26 @@ interface KotlinInterface : JavaInterface {
fun fooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
}
val propertyy: String
get() {
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
return ""
}
override fun testOverride(): String {
return "OK";
}
@@ -32,15 +50,52 @@ interface KotlinInterfaceInderectInheritance : KotlinInterface {
fun foooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterfaceInderectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
}
val propertyyy: String
get() {
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterfaceInderectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
return ""
}
}
open class KotlinClass : JavaInterface {
fun foo(){
fun foo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testOverride<!>()
object {
fun run () {
super@KotlinClass.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
}
}
}
val property: String
get() {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testOverride<!>()
object {
fun run () {
super@KotlinClass.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
}
}
return ""
}
}
class KotlinClassInderectInheritance : KotlinClass() {
@@ -48,23 +103,64 @@ class KotlinClassInderectInheritance : KotlinClass() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.test()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance.test()
}
}
}
val property2: String
get() {
super.test()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance.test()
}
}
return ""
}
}
class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
fun foo(){
fun foo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance2.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
}
}
}
val property: String
get() {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance2.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
}
}
return ""
}
}
fun test() {
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
KotlinClass().foo()
KotlinClass().property
KotlinClassInderectInheritance2().foo()
KotlinClassInderectInheritance2().property
KotlinClass().test()
KotlinClass().property
KotlinClass().testOverride()
KotlinClassInderectInheritance().testOverride()
}
@@ -15,6 +15,7 @@ public interface JavaInterface {
public open class KotlinClass : JavaInterface {
public constructor KotlinClass()
public final val property: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -25,6 +26,8 @@ public open class KotlinClass : JavaInterface {
public final class KotlinClassInderectInheritance : KotlinClass {
public constructor KotlinClassInderectInheritance()
public final override /*1*/ /*fake_override*/ val property: kotlin.String
public final val property2: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit
public final fun foo2(): kotlin.Unit
@@ -36,6 +39,9 @@ public final class KotlinClassInderectInheritance : KotlinClass {
public final class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
public constructor KotlinClassInderectInheritance2()
public final val property: kotlin.String
public open override /*1*/ /*fake_override*/ val propertyy: kotlin.String
public open override /*1*/ /*fake_override*/ val propertyyy: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun fooo(): kotlin.Unit
@@ -47,6 +53,7 @@ public final class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInhe
}
public interface KotlinInterface : JavaInterface {
public open val propertyy: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun fooo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -56,6 +63,8 @@ public interface KotlinInterface : JavaInterface {
}
public interface KotlinInterfaceInderectInheritance : KotlinInterface {
public open override /*1*/ /*fake_override*/ val propertyy: kotlin.String
public open val propertyyy: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun fooo(): kotlin.Unit
public open fun foooo(): kotlin.Unit
@@ -23,8 +23,26 @@ interface KotlinInterface : JavaInterface {
fun fooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
}
val propertyy: String
get() {
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterface.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
return ""
}
override fun testOverride(): String {
return "OK";
}
@@ -34,7 +52,25 @@ interface KotlinInterfaceInderectInheritance : KotlinInterface {
fun foooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterfaceInderectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
}
val propertyyy: String
get() {
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
object {
fun run () {
super@KotlinInterfaceInderectInheritance.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
return ""
}
}
open class KotlinClass : JavaInterface {
@@ -42,7 +78,26 @@ open class KotlinClass : JavaInterface {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>testOverride<!>()
object {
fun run () {
super@KotlinClass.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
}
}
}
val property: String
get() {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>testOverride<!>()
object {
fun run () {
super@KotlinClass.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
}
}
return ""
}
}
class KotlinClassInderectInheritance : KotlinClass() {
@@ -50,7 +105,26 @@ class KotlinClassInderectInheritance : KotlinClass() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.test()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance.test()
}
}
}
val property2: String
get() {
super.test()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance.test()
}
}
return ""
}
}
class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
@@ -58,15 +132,37 @@ class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance2.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
}
}
}
val property: String
get() {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.testOverride()
object {
fun run () {
super@KotlinClassInderectInheritance2.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
}
}
return ""
}
}
fun test() {
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
KotlinClass().foo()
KotlinClass().property
KotlinClassInderectInheritance2().foo()
KotlinClassInderectInheritance2().property
KotlinClass().test()
KotlinClass().property
KotlinClass().testOverride()
KotlinClassInderectInheritance().testOverride()
}
@@ -15,6 +15,7 @@ public interface JavaInterface {
public open class KotlinClass : JavaInterface {
public constructor KotlinClass()
public final val property: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -25,6 +26,8 @@ public open class KotlinClass : JavaInterface {
public final class KotlinClassInderectInheritance : KotlinClass {
public constructor KotlinClassInderectInheritance()
public final override /*1*/ /*fake_override*/ val property: kotlin.String
public final val property2: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit
public final fun foo2(): kotlin.Unit
@@ -36,6 +39,9 @@ public final class KotlinClassInderectInheritance : KotlinClass {
public final class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
public constructor KotlinClassInderectInheritance2()
public final val property: kotlin.String
public open override /*1*/ /*fake_override*/ val propertyy: kotlin.String
public open override /*1*/ /*fake_override*/ val propertyyy: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun fooo(): kotlin.Unit
@@ -47,6 +53,7 @@ public final class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInhe
}
public interface KotlinInterface : JavaInterface {
public open val propertyy: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun fooo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -56,6 +63,8 @@ public interface KotlinInterface : JavaInterface {
}
public interface KotlinInterfaceInderectInheritance : KotlinInterface {
public open override /*1*/ /*fake_override*/ val propertyy: kotlin.String
public open val propertyyy: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun fooo(): kotlin.Unit
public open fun foooo(): kotlin.Unit