From 98d11104260dd8a810d47dc80fd974e421aaed99 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Thu, 12 Sep 2013 17:25:59 +0400 Subject: [PATCH] added different errors instead of ERROR_COMPILE_TIME_VALUE with different text check type for constants in DataFlowUtils GitOrigin-RevId: 9c36936a79913996c6b2d4700e790870de742586 --- .../src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java | 2 +- .../override/typeMismatchOnOverride/afterObjectInsideBody.kt | 2 +- .../override/typeMismatchOnOverride/beforeObjectInsideBody.kt | 2 +- .../afterComponentFunctionReturnTypeMismatch4.kt | 2 +- .../beforeComponentFunctionReturnTypeMismatch4.kt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/kotlin/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java b/plugins/kotlin/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java index 1d3da3cc3621..cd38a64effe7 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java +++ b/plugins/kotlin/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java @@ -164,7 +164,7 @@ public class JetPsiChecker implements Annotator { return; } - if (diagnostic.getFactory() == Errors.ILLEGAL_ESCAPE_SEQUENCE) { + if (diagnostic.getFactory() == Errors.ILLEGAL_ESCAPE) { for (TextRange textRange : diagnostic.getTextRanges()) { Annotation annotation = holder.createErrorAnnotation(textRange, getDefaultMessage(diagnostic)); annotation.setTooltip(getMessage(diagnostic)); diff --git a/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/afterObjectInsideBody.kt b/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/afterObjectInsideBody.kt index ca18a2f71ec6..1b56dabc2764 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/afterObjectInsideBody.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/afterObjectInsideBody.kt @@ -1,5 +1,5 @@ // "Change 'prop' type to 'Int'" "true" -// ERROR: Null can not be a value of a non-null type Int +// ERROR: Null can not be a value of a non-null type jet.Int trait Test { val prop : T } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/beforeObjectInsideBody.kt b/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/beforeObjectInsideBody.kt index 98530b8ef509..87c818e2cd74 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/beforeObjectInsideBody.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/override/typeMismatchOnOverride/beforeObjectInsideBody.kt @@ -1,5 +1,5 @@ // "Change 'prop' type to 'Int'" "true" -// ERROR: Null can not be a value of a non-null type Int +// ERROR: Null can not be a value of a non-null type jet.Int trait Test { val prop : T } diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch4.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch4.kt index a463ad6739ee..ded1a62692a4 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch4.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch4.kt @@ -1,5 +1,5 @@ // "Change 'A.component2' function return type to 'Unit'" "true" -// ERROR: Type mismatch.
Required:jet.Unit
Found:jet.Int
+// ERROR: An integer literal does not conform to the expected type jet.Unit abstract class A { abstract fun component1(): Int fun component2(): Unit = 42 diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt index 984fdd18142a..24f6035667f5 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt @@ -1,5 +1,5 @@ // "Change 'A.component2' function return type to 'Unit'" "true" -// ERROR: Type mismatch.
Required:jet.Unit
Found:jet.Int
+// ERROR: An integer literal does not conform to the expected type jet.Unit abstract class A { abstract fun component1(): Int fun component2() = 42