[PL] Fix: Don't use locations in compiler messages

^KT-58837
This commit is contained in:
Dmitriy Dolovov
2023-05-25 17:13:45 +02:00
committed by Space Team
parent 9f12dae117
commit a01a6b64ad
6 changed files with 59 additions and 29 deletions
@@ -68,7 +68,8 @@ internal class NativeTestGroupingMessageCollector(
|| isUnsafeCompilerArgumentsWarning(message)
|| isLibraryIncludedMoreThanOnceWarning(message)
|| isK2Experimental(message)
|| isLegacyMMWarning(message) -> {
|| isLegacyMMWarning(message)
|| isPartialLinkageWarning(message) -> {
// These warnings are known and should not be reported as errors.
severity
}
@@ -112,6 +113,8 @@ internal class NativeTestGroupingMessageCollector(
// Legacy MM is deprecated and will be removed in 1.9.20. Until that moment we still need to run tests with it.
private fun isLegacyMMWarning(message: String): Boolean = message.startsWith(LEGACY_MM_WARNING_PREFIX)
private fun isPartialLinkageWarning(message: String): Boolean = message.matches(PARTIAL_LINKAGE_WARNING_REGEX)
override fun hasErrors() = hasWarningsWithRaisedSeverity || super.hasErrors()
companion object {
@@ -121,6 +124,8 @@ internal class NativeTestGroupingMessageCollector(
private const val K2_NATIVE_EXPERIMENTAL_WARNING_PREFIX = "Language version 2.0 is experimental"
private const val LEGACY_MM_WARNING_PREFIX = "Legacy MM is deprecated and will be removed"
private val PARTIAL_LINKAGE_WARNING_REGEX = Regex("^<[^<>]+>( @ (?:(?!: ).)+)?: .*")
private fun parseLanguageFeatureArg(arg: String): String? =
substringAfter(arg, "-XXLanguage:-") ?: substringAfter(arg, "-XXLanguage:+")
}