Do not write version requirements in metadata for lambdas

#KT-29790 Fixed
This commit is contained in:
Alexander Udalov
2019-03-07 14:58:02 +01:00
parent e942bff4a2
commit 584137121b
8 changed files with 81 additions and 46 deletions
@@ -172,4 +172,32 @@ class MetadataSmokeTest {
assertEquals("kotlin/coroutines/CoroutineContext.Key", coroutineContextKey)
assertEquals("kotlin/coroutines/CoroutineContext\$Key", coroutineContextKey.jvmInternalName)
}
/*
// TODO: uncomment after bootstrap compiler has a fix for KT-29790
@Test
fun lambdaVersionRequirement() {
val x: suspend Int.(String, String) -> Unit = { _, _ -> }
val annotation = x::class.java.getAnnotation(Metadata::class.java)!!
val metadata = KotlinClassMetadata.read(
KotlinClassHeader(
kind = annotation.kind,
metadataVersion = annotation.metadataVersion,
bytecodeVersion = annotation.bytecodeVersion,
data1 = annotation.data1,
data2 = annotation.data2,
extraInt = annotation.extraInt,
extraString = annotation.extraString,
packageName = annotation.packageName
)
) as KotlinClassMetadata.SyntheticClass
metadata.accept(object : KmLambdaVisitor() {
override fun visitFunction(flags: Flags, name: String) =
object : KmFunctionVisitor() {
override fun visitVersionRequirement() =
object : KmVersionRequirementVisitor() {}
}
})
}
*/
}