JVM IR: do not generate DefaultImpls delegate for collection fake overrides
In the newly added test, prior to this change, JVM IR was generating DefaultImpls classes with calls to things like `kotlin/collections/MutableList$DefaultImpls.spliterator` and other default methods present in JDK 8+. This obviously didn't make much sense. Although these weren't explicitly mentioned anywhere in the bytecode, they caused some validation tools to report errors (e.g. animalsniffer used in arrow).
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// FULL_JDK
|
||||
// FILE: J.java
|
||||
|
||||
public interface J {
|
||||
default void foo() {}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
interface K : J
|
||||
|
||||
interface MyList<T> : MutableList<T>
|
||||
interface MySet<E> : MutableSet<E>
|
||||
interface MyMap<K, V> : MutableMap<K, V>
|
||||
|
||||
interface MyMap2<X, Y> : MyMap<X, Y>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@kotlin.Metadata
|
||||
public interface K
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MyList
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MyMap
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MyMap2
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MySet
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// JVM_TARGET: 1.8
|
||||
// FULL_JDK
|
||||
// FILE: J.java
|
||||
|
||||
public interface J {
|
||||
default void foo() {}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
interface K : J
|
||||
|
||||
interface MyList<T> : MutableList<T>
|
||||
interface MySet<E> : MutableSet<E>
|
||||
interface MyMap<K, V> : MutableMap<K, V>
|
||||
|
||||
interface MyMap2<X, Y> : MyMap<X, Y>
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
@kotlin.Metadata
|
||||
public interface K
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MyList
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MyMap
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MyMap2
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface MySet
|
||||
Reference in New Issue
Block a user