[JVM] Forbid non-JvmInline value classes again
This commit is contained in:
committed by
Space
parent
7595f798e1
commit
df1de3a7d3
+6
-2
@@ -7,12 +7,16 @@ package org.jetbrains.kotlin.generators.model
|
||||
|
||||
class WithoutJvmInlineTestMethodModel(
|
||||
source: SimpleTestMethodModel,
|
||||
withAnnotation: Boolean,
|
||||
withAnnotation: Boolean?,
|
||||
withPostfix: Boolean,
|
||||
) : TransformingTestMethodModel(
|
||||
source,
|
||||
transformer = "TransformersFunctions.get" +
|
||||
if (withAnnotation) "ReplaceOptionalJvmInlineAnnotationWithReal()" else "RemoveOptionalJvmInlineAnnotation()"
|
||||
when (withAnnotation) {
|
||||
true -> "ReplaceOptionalJvmInlineAnnotationWithReal()"
|
||||
false -> "RemoveOptionalJvmInlineAnnotation()"
|
||||
null -> "ReplaceOptionalJvmInlineAnnotationWithUniversal()"
|
||||
}
|
||||
) {
|
||||
override val name: String = source.name + if (withPostfix) "_valueClasses" else ""
|
||||
}
|
||||
+3
-3
@@ -42,9 +42,9 @@ fun methodModelLocator(
|
||||
).let { methodModel ->
|
||||
if (methodModel.containsWithoutJvmInline()) {
|
||||
val isWithAnnotationAndIsWithPostfix = when {
|
||||
!targetBackend.isRecursivelyCompatibleWith(TargetBackend.JVM) -> listOf(false to false)
|
||||
targetBackend.isIR -> listOf(true to false, false to true)
|
||||
else -> listOf(true to false)
|
||||
targetBackend.isRecursivelyCompatibleWith(TargetBackend.JVM) -> listOf(true to false)
|
||||
targetBackend == TargetBackend.ANY -> listOf(null to false)
|
||||
else -> listOf(false to false)
|
||||
}
|
||||
isWithAnnotationAndIsWithPostfix.map { (ann, post) -> WithoutJvmInlineTestMethodModel(methodModel, ann, post) }
|
||||
} else listOf(methodModel)
|
||||
|
||||
Reference in New Issue
Block a user