diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index a8db4bd1caf..35c65c4d78c 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -546,6 +546,12 @@ Also sets `-jvm-target` value equal to the selected JDK version""" ) var oldInnerClassesLogic: Boolean by FreezableVar(false) + @Argument( + value = "-Xvalue-classes", + description = "Enable experimental value classes" + ) + var valueClasses: Boolean by FreezableVar(false) + override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap, Any> { val result = super.configureAnalysisFlags(collector, languageVersion) result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics @@ -581,6 +587,9 @@ Also sets `-jvm-target` value equal to the selected JDK version""" result[LanguageFeature.ForbidSuperDelegationToAbstractFakeOverride] = LanguageFeature.State.ENABLED result[LanguageFeature.AbstractClassMemberNotImplementedWithIntermediateAbstractClass] = LanguageFeature.State.ENABLED } + if (valueClasses) { + result[LanguageFeature.ValueClasses] = LanguageFeature.State.ENABLED + } return result } diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 993274d0742..6c78ff26338 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -157,6 +157,7 @@ where advanced options include: -Xuse-type-table Use type table in metadata serialization -Xvalidate-bytecode Validate generated JVM bytecode before and after optimizations -Xvalidate-ir Validate IR before and after lowering + -Xvalue-classes Enable experimental value classes -Xallow-any-scripts-in-source-roots Allow to compile any scripts along with regular Kotlin sources -Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info diff --git a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt index 14edff52a11..42546d51900 100644 --- a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt +++ b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt @@ -165,6 +165,7 @@ class CompilerArgumentsContentProspectorTest { K2JVMCompilerArguments::noUnifiedNullChecks, K2JVMCompilerArguments::useOldInlineClassesManglingScheme, K2JVMCompilerArguments::enableJvmPreview, + K2JVMCompilerArguments::valueClasses, ) private val k2JVMCompilerArgumentsStringProperties = commonCompilerArgumentsStringProperties + listOf(