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:
Alexander Udalov
2019-10-01 18:53:45 +02:00
parent 45ab07654e
commit 0c939d2f86
8 changed files with 26 additions and 4 deletions
@@ -0,0 +1,3 @@
public interface A {
public static void method() {}
}
@@ -0,0 +1,5 @@
inline fun foo(crossinline x: () -> Unit): Any = object {
init {
x()
}
}
@@ -0,0 +1,5 @@
fun main() {
foo {
A.method()
}
}