"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "compiler/tests-common/tests/org/jetbrains/kotlin/checkers/CompilerTestLanguageVersionSettings.kt" between
kotlin-1.3.20.tar.gz and kotlin-1.3.21.tar.gz

About: Kotlin is a Java like statically typed programming language for the JVM, Android and the browser. Source code.

CompilerTestLanguageVersionSettings.kt  (kotlin-1.3.20):CompilerTestLanguageVersionSettings.kt  (kotlin-1.3.21)
skipping to change at line 24 skipping to change at line 24
const val LANGUAGE_DIRECTIVE = "LANGUAGE" const val LANGUAGE_DIRECTIVE = "LANGUAGE"
const val API_VERSION_DIRECTIVE = "API_VERSION" const val API_VERSION_DIRECTIVE = "API_VERSION"
const val EXPERIMENTAL_DIRECTIVE = "EXPERIMENTAL" const val EXPERIMENTAL_DIRECTIVE = "EXPERIMENTAL"
const val USE_EXPERIMENTAL_DIRECTIVE = "USE_EXPERIMENTAL" const val USE_EXPERIMENTAL_DIRECTIVE = "USE_EXPERIMENTAL"
const val IGNORE_DATA_FLOW_IN_ASSERT_DIRECTIVE = "IGNORE_DATA_FLOW_IN_ASSERT" const val IGNORE_DATA_FLOW_IN_ASSERT_DIRECTIVE = "IGNORE_DATA_FLOW_IN_ASSERT"
const val JVM_DEFAULT_MODE = "JVM_DEFAULT_MODE" const val JVM_DEFAULT_MODE = "JVM_DEFAULT_MODE"
const val SKIP_METADATA_VERSION_CHECK = "SKIP_METADATA_VERSION_CHECK" const val SKIP_METADATA_VERSION_CHECK = "SKIP_METADATA_VERSION_CHECK"
const val ALLOW_RESULT_RETURN_TYPE = "ALLOW_RESULT_RETURN_TYPE" const val ALLOW_RESULT_RETURN_TYPE = "ALLOW_RESULT_RETURN_TYPE"
const val SANITIZE_PARENTHESES = "SANITIZE_PARENTHESES"
data class CompilerTestLanguageVersionSettings( data class CompilerTestLanguageVersionSettings(
private val initialLanguageFeatures: Map<LanguageFeature, LanguageFeatur e.State>, private val initialLanguageFeatures: Map<LanguageFeature, LanguageFeatur e.State>,
override val apiVersion: ApiVersion, override val apiVersion: ApiVersion,
override val languageVersion: LanguageVersion, override val languageVersion: LanguageVersion,
private val analysisFlags: Map<AnalysisFlag<*>, Any?> = emptyMap() private val analysisFlags: Map<AnalysisFlag<*>, Any?> = emptyMap()
) : LanguageVersionSettings { ) : LanguageVersionSettings {
private val languageFeatures = specificFeaturesForTests() + initialLanguageF eatures private val languageFeatures = specificFeaturesForTests() + initialLanguageF eatures
private val delegate = LanguageVersionSettingsImpl(languageVersion, apiVersi on, emptyMap(), languageFeatures) private val delegate = LanguageVersionSettingsImpl(languageVersion, apiVersi on, emptyMap(), languageFeatures)
skipping to change at line 62 skipping to change at line 63
fun parseLanguageVersionSettings(directiveMap: Map<String, String>): CompilerTes tLanguageVersionSettings? { fun parseLanguageVersionSettings(directiveMap: Map<String, String>): CompilerTes tLanguageVersionSettings? {
val apiVersionString = directiveMap[API_VERSION_DIRECTIVE] val apiVersionString = directiveMap[API_VERSION_DIRECTIVE]
val languageFeaturesString = directiveMap[LANGUAGE_DIRECTIVE] val languageFeaturesString = directiveMap[LANGUAGE_DIRECTIVE]
val experimental = directiveMap[EXPERIMENTAL_DIRECTIVE]?.split(' ')?.let { A nalysisFlags.experimental to it } val experimental = directiveMap[EXPERIMENTAL_DIRECTIVE]?.split(' ')?.let { A nalysisFlags.experimental to it }
val useExperimental = directiveMap[USE_EXPERIMENTAL_DIRECTIVE]?.split(' ')?. let { AnalysisFlags.useExperimental to it } val useExperimental = directiveMap[USE_EXPERIMENTAL_DIRECTIVE]?.split(' ')?. let { AnalysisFlags.useExperimental to it }
val ignoreDataFlowInAssert = AnalysisFlags.ignoreDataFlowInAssert to directi veMap.containsKey(IGNORE_DATA_FLOW_IN_ASSERT_DIRECTIVE) val ignoreDataFlowInAssert = AnalysisFlags.ignoreDataFlowInAssert to directi veMap.containsKey(IGNORE_DATA_FLOW_IN_ASSERT_DIRECTIVE)
val enableJvmDefault = directiveMap[JVM_DEFAULT_MODE]?.let { JvmAnalysisFlag s.jvmDefaultMode to JvmDefaultMode.fromStringOrNull(it)!! } val enableJvmDefault = directiveMap[JVM_DEFAULT_MODE]?.let { JvmAnalysisFlag s.jvmDefaultMode to JvmDefaultMode.fromStringOrNull(it)!! }
val skipMetadataVersionCheck = AnalysisFlags.skipMetadataVersionCheck to dir ectiveMap.containsKey(SKIP_METADATA_VERSION_CHECK) val skipMetadataVersionCheck = AnalysisFlags.skipMetadataVersionCheck to dir ectiveMap.containsKey(SKIP_METADATA_VERSION_CHECK)
val allowResultReturnType = AnalysisFlags.allowResultReturnType to directive Map.containsKey(ALLOW_RESULT_RETURN_TYPE) val allowResultReturnType = AnalysisFlags.allowResultReturnType to directive Map.containsKey(ALLOW_RESULT_RETURN_TYPE)
val sanitizeParentheses = JvmAnalysisFlags.sanitizeParentheses to directiveM ap.containsKey(SANITIZE_PARENTHESES)
if (apiVersionString == null && languageFeaturesString == null && experiment if (apiVersionString == null && languageFeaturesString == null && experiment
al == null && al == null && useExperimental == null &&
useExperimental == null && !ignoreDataFlowInAssert.second && !allowResul !ignoreDataFlowInAssert.second && enableJvmDefault == null && !skipMetad
tReturnType.second ataVersionCheck.second && !allowResultReturnType.second &&
!sanitizeParentheses.second
) { ) {
return null return null
} }
val apiVersion = (if (apiVersionString != null) ApiVersion.parse(apiVersionS tring) else ApiVersion.LATEST_STABLE) val apiVersion = (if (apiVersionString != null) ApiVersion.parse(apiVersionS tring) else ApiVersion.LATEST_STABLE)
?: error("Unknown API version: $apiVersionString") ?: error("Unknown API version: $apiVersionString")
val languageVersion = maxOf(LanguageVersion.LATEST_STABLE, LanguageVersion.f romVersionString(apiVersion.versionString)!!) val languageVersion = maxOf(LanguageVersion.LATEST_STABLE, LanguageVersion.f romVersionString(apiVersion.versionString)!!)
val languageFeatures = languageFeaturesString?.let(::collectLanguageFeatureM ap).orEmpty() val languageFeatures = languageFeaturesString?.let(::collectLanguageFeatureM ap).orEmpty()
return CompilerTestLanguageVersionSettings( return CompilerTestLanguageVersionSettings(
languageFeatures, apiVersion, languageVersion, languageFeatures, apiVersion, languageVersion,
mapOf( mapOf(
*listOfNotNull( *listOfNotNull(
experimental, useExperimental, enableJvmDefault, ignoreDataFlowI experimental, useExperimental, enableJvmDefault, ignoreDataFlowI
nAssert, skipMetadataVersionCheck, allowResultReturnType nAssert, skipMetadataVersionCheck, allowResultReturnType,
sanitizeParentheses
).toTypedArray() ).toTypedArray()
) )
) )
} }
fun defaultLanguageVersionSettings(): CompilerTestLanguageVersionSettings = fun defaultLanguageVersionSettings(): CompilerTestLanguageVersionSettings =
CompilerTestLanguageVersionSettings(emptyMap(), ApiVersion.LATEST_STABLE, La nguageVersion.LATEST_STABLE) CompilerTestLanguageVersionSettings(emptyMap(), ApiVersion.LATEST_STABLE, La nguageVersion.LATEST_STABLE)
fun setupLanguageVersionSettingsForMultifileCompilerTests(files: List<File>, env ironment: KotlinCoreEnvironment) { fun setupLanguageVersionSettingsForMultifileCompilerTests(files: List<File>, env ironment: KotlinCoreEnvironment) {
val allDirectives = HashMap<String, String>() val allDirectives = HashMap<String, String>()
 End of changes. 4 change blocks. 
6 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)