diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index ad376b3cf94..686696c5eba 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -527,7 +527,7 @@ public interface Errors { DiagnosticFactory1 COMPARE_TO_TYPE_MISMATCH = DiagnosticFactory1.create(ERROR); - DiagnosticFactory0 UNDESCORE_IS_DEPRECATED = DiagnosticFactory0.create(WARNING); + DiagnosticFactory0 UNDERSCORE_IS_DEPRECATED = DiagnosticFactory0.create(WARNING); DiagnosticFactory0 INAPPLICABLE_OPERATOR_MODIFIER = DiagnosticFactory0.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 463bfc8045d..4cc80cd89c9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -357,7 +357,7 @@ public class DefaultErrorMessages { MAP.put(COMPARE_TO_TYPE_MISMATCH, "''compareTo()'' must return kotlin.Int, but returns {0}", RENDER_TYPE); - MAP.put(UNDESCORE_IS_DEPRECATED, "Names _, __, ___, ..., are deprecated"); + MAP.put(UNDERSCORE_IS_DEPRECATED, "Names _, __, ___, ..., are deprecated"); MAP.put(INAPPLICABLE_OPERATOR_MODIFIER, "'operator' modifier is inapplicable on this function"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/UnderscoreChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/UnderscoreChecker.kt index f619fdd1c55..07b7d8e87ef 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/UnderscoreChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/UnderscoreChecker.kt @@ -30,7 +30,7 @@ object UnderscoreChecker : DeclarationChecker { fun checkIdentifier(identifier: PsiElement?, diagnosticHolder: DiagnosticSink) { if (identifier == null || identifier.text.isEmpty()) return if (identifier.text.all { it == '_' }) { - diagnosticHolder.report(Errors.UNDESCORE_IS_DEPRECATED.on(identifier)) + diagnosticHolder.report(Errors.UNDERSCORE_IS_DEPRECATED.on(identifier)) } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt index 11a55681f37..96637581b8a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt @@ -102,7 +102,7 @@ class LazyImportResolver( } for ((alias, import) in explicitClassImports.entries()) { if (alias.all { it == '_' }) { - traceForImportResolve.report(Errors.UNDESCORE_IS_DEPRECATED.on(import)) + traceForImportResolve.report(Errors.UNDERSCORE_IS_DEPRECATED.on(import)) } } for (alias in explicitClassImports.keySet()) { diff --git a/compiler/testData/diagnostics/tests/Underscore.kt b/compiler/testData/diagnostics/tests/Underscore.kt index 532f69758a0..6cad835e3be 100644 --- a/compiler/testData/diagnostics/tests/Underscore.kt +++ b/compiler/testData/diagnostics/tests/Underscore.kt @@ -1,16 +1,16 @@ // !DIAGNOSTICS: -DEPRECATED_SYMBOL_WITH_MESSAGE -import kotlin.Deprecated as ___ +import kotlin.Deprecated as ___ @___("") data class Pair(val x: Int, val y: Int) -class _<________> -val ______ = _() +class _<________> +val ______ = _() -fun __(___: Int, y: _?): Int { - val (x, __________) = Pair(___ - 1, 42) - val ____ = x +fun __(___: Int, y: _?): Int { + val (x, __________) = Pair(___ - 1, 42) + val ____ = x // in backquotes: allowed val `_` = __________ - __@ return if (y != null) __(____, y) else __(`_`, ______) + __@ return if (y != null) __(____, y) else __(`_`, ______) } \ No newline at end of file