Report missed INLINE_FROM_HIGHER_PLATFORM diagnostic for derived class

Inline function descriptor in derived class represented as FAKE_OVERRIDE.
 So we should find it in base class declaration
 (not interface cause inline function can't be virtual, but always final)
 and then check class version.

 #KT-29402 Fixed
This commit is contained in:
Mikhael Bogdanov
2019-01-21 14:00:44 +01:00
parent b03065b2ba
commit a020170a92
11 changed files with 219 additions and 45 deletions
@@ -449,7 +449,22 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
fun testWrongInlineTarget() {
val library = compileLibrary("library", additionalOptions = listOf("-jvm-target", "1.8"))
compileKotlin("source.kt", tmpdir, listOf(library))
compileKotlin(
"source.kt", tmpdir, listOf(library),
/*all warning here are erased by compiler cause or error presence, see next test for warnings*/
expectedFileName = "errorsAndErasedWarnings.txt"
)
compileKotlin(
"warningsOnly.kt", tmpdir, listOf(library),
expectedFileName = "warningsOnly.txt"
)
compileKotlin(
"source.kt", tmpdir, listOf(library),
additionalOptions = listOf("-XXLanguage:+ProperInlineFromHigherPlatformDiagnostic"),
expectedFileName = "properError.txt"
)
}
fun testObsoleteInlineSuspend() {