Use correct class file version when copying anonymous objects in inliner
Generally, using state.classFileVersion would be enough because we report an error when inlining bytecode into a class file with a lower target version (see INLINE_FROM_HIGHER_PLATFORM). However, we take maxOf with the original version of the class file, _just in case_ the user has suppressed this error (for example, to workaround some other corner case in the compiler). #KT-30744 Fixed
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
public interface A {
|
||||
public static void method() {}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
inline fun foo(crossinline x: () -> Unit): Any = object {
|
||||
init {
|
||||
x()
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
OK
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun main() {
|
||||
foo {
|
||||
A.method()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user