Fix for KT-16614: Report inability to inline 1.8 bytecode into 1.6 bytecode as an error, no as an exception
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
// JVM_TARGET: 1.8
|
||||
package a
|
||||
|
||||
inline fun inlineFun(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
var inlineGetter: Int
|
||||
inline get() = 1
|
||||
set(varue) {}
|
||||
|
||||
var inlineSetter: Int
|
||||
get() = 1
|
||||
inline set(varue) {}
|
||||
|
||||
var allInline: Int
|
||||
inline get() = 1
|
||||
inline set(varue) {}
|
||||
|
||||
|
||||
|
||||
class A {
|
||||
inline fun inlineFun(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
var inlineGetter: Int
|
||||
inline get() = 1
|
||||
set(varue) {}
|
||||
|
||||
var inlineSetter: Int
|
||||
get() = 1
|
||||
inline set(varue) {}
|
||||
|
||||
var allInline: Int
|
||||
inline get() = 1
|
||||
inline set(varue) {}
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:6:5: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
inlineFun {}
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:7:5: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
inlineGetter
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:8:5: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
inlineGetter = 1
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:11:5: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
inlineSetter = 1
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:13:5: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
allInline
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:14:5: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
allInline = 1
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:17:7: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
a.inlineFun {}
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:18:7: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
a.inlineGetter
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:19:7: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
a.inlineGetter = 1
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:22:7: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
a.inlineSetter = 1
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:24:7: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
a.allInline
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/source.kt:25:7: error: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
|
||||
a.allInline = 1
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package usage
|
||||
|
||||
import a.*
|
||||
|
||||
fun baz() {
|
||||
inlineFun {}
|
||||
inlineGetter
|
||||
inlineGetter = 1
|
||||
|
||||
inlineSetter
|
||||
inlineSetter = 1
|
||||
|
||||
allInline
|
||||
allInline = 1
|
||||
|
||||
val a = A()
|
||||
a.inlineFun {}
|
||||
a.inlineGetter
|
||||
a.inlineGetter = 1
|
||||
|
||||
a.inlineSetter
|
||||
a.inlineSetter = 1
|
||||
|
||||
a.allInline
|
||||
a.allInline = 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user