Set AnalysisFlags.explicitApiVersion in tests with API_VERSION directive

To mimic the case of user passing an explicit "-api-version" flag to
avoid API version being inferred to the version of stdlib in
dependencies by JvmRuntimeVersionsConsistencyChecker
This commit is contained in:
Alexander Udalov
2019-07-26 16:32:43 +02:00
parent 9456763576
commit 13b07e71e8
@@ -68,7 +68,8 @@ fun parseLanguageVersionSettings(directives: Map<String, String>): CompilerTestL
analysisFlag(JvmAnalysisFlags.sanitizeParentheses, if (SANITIZE_PARENTHESES in directives) true else null),
analysisFlag(AnalysisFlags.constraintSystemForOverloadResolution, directives[CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION]?.let {
ConstraintSystemForOverloadResolutionMode.valueOf(it)
})
}),
analysisFlag(AnalysisFlags.explicitApiVersion, if (apiVersionString != null) true else null)
)
if (apiVersionString == null && languageFeaturesString == null && analysisFlags.isEmpty()) {