[CLI] Don't suggest enabling test-only features
This commit changes the error message from:
main.kt:2:11: error: the feature "references to synthetic java properties" is experimental and should be enabled explicitly. This can be done by supplying the compiler argument '-XXLanguage:+ReferencesToSyntheticJavaProperties', but note that no stability guarantees are provided.
to
main.kt:2:11: error: the feature "references to synthetic java properties" is unsupported.
diff --git a/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/rendering/LanguageFeatureMessageRenderer.kt b/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/rendering/LanguageFeatureMessageRenderer.kt
index 8782156..4e42385 100644
--- a/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/rendering/LanguageFeatureMessageRenderer.kt
+++ b/compiler/frontend.common-psi/src/org/jetbrains/kotlin/diagnostics/rendering/LanguageFeatureMessageRenderer.kt
@@ -38,6 +38,8 @@
when {
settings.supportsFeature(feature) && settings.languageVersion < LanguageVersion.KOTLIN_2_0 ->
sb.append("not supported in language versions 1.*, please use version 2.0 or later")
+ feature.kind.testOnly ->
+ sb.append("unsupported.")
since == null ->
sb.append("experimental and should be enabled explicitly. This can be done by supplying the compiler argument '$featureFlag', but note that no stability guarantees are provided.")
since > settings.languageVersion ->