Switch DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET according to LL

This commit is contained in:
Mikhael Bogdanov
2017-11-16 16:48:32 +01:00
parent d386712903
commit a547019ed0
25 changed files with 250 additions and 42 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import java.util.stream.Collectors
import java.util.stream.IntStream
fun main(args: Array<String>) {
val xs = IntStream.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>range<!>(0, 10).mapToObj { it.toString() }
val xs = IntStream.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>range<!>(0, 10).mapToObj { it.toString() }
.collect(Collectors.toList())
xs[0]
}
+9 -9
View File
@@ -19,7 +19,7 @@ import JavaInterface.testStatic
interface KotlinInterface : JavaInterface {
fun fooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
@@ -30,22 +30,22 @@ interface KotlinInterface : JavaInterface {
interface KotlinInterfaceInderectInheritance : KotlinInterface {
fun foooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
open class KotlinClass : JavaInterface {
fun foo(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>testOverride<!>()
<!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<!>()
}
}
class KotlinClassInderectInheritance : KotlinClass() {
fun foo2(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.test()
super.testOverride()
}
@@ -53,14 +53,14 @@ class KotlinClassInderectInheritance : KotlinClass() {
class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
fun foo(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
super.testOverride()
}
}
fun test() {
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
KotlinClass().foo()
KotlinClassInderectInheritance2().foo()
@@ -24,7 +24,7 @@ import JavaInterface.testStatic
interface KotlinInterface : JavaInterface {
fun fooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
test()
testOverride()
@@ -37,7 +37,7 @@ interface KotlinInterface : JavaInterface {
interface KotlinInterfaceIndirectInheritance : KotlinInterface {
fun foooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
testOverride()
super.testOverride()
@@ -46,15 +46,15 @@ interface KotlinInterfaceIndirectInheritance : KotlinInterface {
open class KotlinClass : JavaInterface {
fun foo(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>testOverride<!>()
<!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<!>()
}
}
class KotlinClassIndirectInheritance : KotlinClass() {
fun foo2(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.test()
super.testOverride()
}
@@ -62,14 +62,14 @@ class KotlinClassIndirectInheritance : KotlinClass() {
class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
fun foo(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
super.testOverride()
}
}
fun test() {
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>testStatic<!>()
KotlinClass().foo()
KotlinClassIndirectInheritance2().foo()
@@ -0,0 +1,72 @@
//!LANGUAGE: -DefaultMethodsCallFromJava6TargetError
// FILE: JavaInterface.java
public interface JavaInterface {
static String testStatic() {
return "OK";
}
default String test() {
return "OK";
}
default String testOverride() {
return "OK";
}
}
// FILE: 1.kt
import JavaInterface.testStatic
interface KotlinInterface : JavaInterface {
fun fooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
override fun testOverride(): String {
return "OK";
}
}
interface KotlinInterfaceInderectInheritance : KotlinInterface {
fun foooo() {
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER!>test<!>()
}
}
open class KotlinClass : JavaInterface {
fun foo(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>testOverride<!>()
}
}
class KotlinClassInderectInheritance : KotlinClass() {
fun foo2(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.test()
super.testOverride()
}
}
class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
fun foo(){
<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.testOverride()
}
}
fun test() {
JavaInterface.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>testStatic<!>()
KotlinClass().foo()
KotlinClassInderectInheritance2().foo()
KotlinClass().test()
KotlinClass().testOverride()
KotlinClassInderectInheritance().testOverride()
}
@@ -0,0 +1,66 @@
package
public fun test(): kotlin.Unit
public interface JavaInterface {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open fun test(): kotlin.String!
public open fun testOverride(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
// Static members
public open fun testStatic(): kotlin.String!
}
public open class KotlinClass : JavaInterface {
public constructor KotlinClass()
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
public open override /*1*/ /*fake_override*/ fun test(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun testOverride(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class KotlinClassInderectInheritance : KotlinClass {
public constructor KotlinClassInderectInheritance()
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
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun test(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun testOverride(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class KotlinClassInderectInheritance2 : KotlinInterfaceInderectInheritance {
public constructor KotlinClassInderectInheritance2()
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
public open override /*1*/ /*fake_override*/ fun foooo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun test(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun testOverride(): kotlin.String
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface KotlinInterface : JavaInterface {
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
public open override /*1*/ /*fake_override*/ fun test(): kotlin.String!
public open override /*1*/ fun testOverride(): kotlin.String
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface KotlinInterfaceInderectInheritance : KotlinInterface {
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
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun test(): kotlin.String!
public open override /*1*/ /*fake_override*/ fun testOverride(): kotlin.String
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -18,7 +18,7 @@ class K : C()
fun main(args: Array<String>) {
I.a
I.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>foo<!>()
I.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>foo<!>()
C.a
C.b
@@ -25,7 +25,7 @@ interface KTrait2 : KTrait {
class A : KTrait {
fun a() {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
test()
}
@@ -34,7 +34,7 @@ class A : KTrait {
class A2 : KTrait2 {
fun a() {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>test<!>()
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>test<!>()
test()
}
@@ -3,7 +3,7 @@
import java.util.stream.*
interface A : Collection<String> {
override fun stream(): Stream<String> = Stream.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET!>of<!>()
override fun stream(): Stream<String> = Stream.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>of<!>()
}
fun foo(x: List<String>, y: A) {
@@ -2,7 +2,7 @@
abstract class A : MutableList<String> {
override fun sort(/*0*/ p0: java.util.Comparator<in String>) {
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET!>sort<!>(p0)
super.<!DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>sort<!>(p0)
}
}