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:
Alexander Udalov
2020-05-14 22:18:03 +02:00
parent 47c25982b6
commit 5647a935a2
9 changed files with 178 additions and 15 deletions
@@ -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>
@@ -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
@@ -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>
@@ -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