Report error on missed specialization in compatibility mode
#KT-39603 Fixed
This commit is contained in:
@@ -9,6 +9,7 @@ interface Z<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefaultWithoutCompatibility
|
||||
open class ZImpl : Z<String>
|
||||
|
||||
class ZImpl2 : ZImpl() {
|
||||
|
||||
@@ -9,8 +9,11 @@ interface Z<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefaultWithoutCompatibility
|
||||
open class ZImpl : Z<String>
|
||||
|
||||
//TODO: this is redundant, revise diagnostic
|
||||
@JvmDefaultWithoutCompatibility
|
||||
open class ZImpl2 : Z<String>, ZImpl()
|
||||
|
||||
class ZImpl3 : ZImpl2() {
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// JVM_TARGET: 1.8
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
interface Foo<T> {
|
||||
fun test(p: T) = p
|
||||
val T.prop: T
|
||||
get() = this
|
||||
}
|
||||
|
||||
open class BaseSpecialized : Foo<String> {
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val base = BaseSpecialized()
|
||||
return base.test("O") + with(base) { "K".prop }
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
interface Base {
|
||||
fun test(): Int? = 0
|
||||
}
|
||||
|
||||
interface Derived: Base {
|
||||
override fun test(): Int = 1
|
||||
}
|
||||
|
||||
interface Mixed: Base, Derived
|
||||
|
||||
open class A: Base, Derived
|
||||
open class B: Mixed
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
@kotlin.Metadata
|
||||
public class A {
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public class B {
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Base$DefaultImpls {
|
||||
inner class Base$DefaultImpls
|
||||
public static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: Base): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface Base {
|
||||
inner class Base$DefaultImpls
|
||||
public synthetic static method access$test$jd(p0: Base): java.lang.Integer
|
||||
public @org.jetbrains.annotations.Nullable method test(): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Derived$DefaultImpls {
|
||||
inner class Derived$DefaultImpls
|
||||
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface Derived {
|
||||
inner class Derived$DefaultImpls
|
||||
public synthetic static method access$test$jd(p0: Derived): int
|
||||
public @org.jetbrains.annotations.NotNull method test(): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Mixed$DefaultImpls {
|
||||
inner class Mixed$DefaultImpls
|
||||
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface Mixed {
|
||||
inner class Mixed$DefaultImpls
|
||||
public synthetic static method access$test$jd(p0: Mixed): int
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// !JVM_DEFAULT_MODE: all-compatibility
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
interface Base {
|
||||
fun test(): Int? = 0
|
||||
}
|
||||
|
||||
interface Derived: Base {
|
||||
override fun test(): Int = 1
|
||||
}
|
||||
|
||||
interface Mixed: Base, Derived
|
||||
|
||||
open class A: Base, Derived
|
||||
open class B: Mixed
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
@kotlin.Metadata
|
||||
public class A {
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public class B {
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Base$DefaultImpls {
|
||||
inner class Base$DefaultImpls
|
||||
public static @org.jetbrains.annotations.Nullable method test(@org.jetbrains.annotations.NotNull p0: Base): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface Base {
|
||||
inner class Base$DefaultImpls
|
||||
public synthetic static method access$test$jd(p0: Base): java.lang.Integer
|
||||
public @org.jetbrains.annotations.Nullable method test(): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Derived$DefaultImpls {
|
||||
inner class Derived$DefaultImpls
|
||||
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Derived): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface Derived {
|
||||
inner class Derived$DefaultImpls
|
||||
public synthetic static method access$test$jd(p0: Derived): int
|
||||
public @org.jetbrains.annotations.NotNull method test(): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Mixed$DefaultImpls {
|
||||
inner class Mixed$DefaultImpls
|
||||
public static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: Mixed): java.lang.Integer
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface Mixed {
|
||||
inner class Mixed$DefaultImpls
|
||||
public synthetic static method access$test$jd(p0: Mixed): int
|
||||
}
|
||||
Reference in New Issue
Block a user