JVM: remove source code from not null assertion message text

This is implemented under a LanguageFeature which will be enabled later,
when behavior change described in KT-57570 is approved.

 #KT-57570
This commit is contained in:
Alexander Udalov
2023-04-25 00:59:52 +02:00
committed by Space Team
parent ea264cb5b5
commit fc0ce415d7
28 changed files with 746 additions and 90 deletions
@@ -320,9 +320,17 @@ class GenerationState private constructor(
val assertionsMode: JVMAssertionsMode = configuration.get(JVMConfigurationKeys.ASSERTIONS_MODE, JVMAssertionsMode.DEFAULT)
val isInlineDisabled: Boolean = configuration.getBoolean(CommonConfigurationKeys.DISABLE_INLINE)
val useTypeTableInSerializer: Boolean = configuration.getBoolean(JVMConfigurationKeys.USE_TYPE_TABLE)
val unifiedNullChecks: Boolean =
languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_4 &&
!configuration.getBoolean(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS)
val unifiedNullChecks: Boolean = (
languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_4 &&
!configuration.getBoolean(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS)
).also {
check(it || !languageVersionSettings.supportsFeature(LanguageFeature.NoSourceCodeInNotNullAssertionExceptions)) {
// This assertion is needed because we generate calls to `Intrinsics.checkNotNull` which is only available since 1.4.
"Language feature ${LanguageFeature.NoSourceCodeInNotNullAssertionExceptions.name} is not supported " +
"if -Xno-unified-null-checks is enabled."
}
}
val generateSmapCopyToAnnotation: Boolean = !configuration.getBoolean(JVMConfigurationKeys.NO_SOURCE_DEBUG_EXTENSION)
val functionsWithInlineClassReturnTypesMangled: Boolean =
languageVersionSettings.supportsFeature(LanguageFeature.MangleClassMembersReturningInlineClasses)