diff --git a/compiler/tests/org/jetbrains/kotlin/test/JetTestUtils.java b/compiler/tests/org/jetbrains/kotlin/test/JetTestUtils.java index fa5c0b7e014..c08ba7d0c51 100644 --- a/compiler/tests/org/jetbrains/kotlin/test/JetTestUtils.java +++ b/compiler/tests/org/jetbrains/kotlin/test/JetTestUtils.java @@ -22,6 +22,7 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.intellij.openapi.Disposable; import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.ShutDownTracker; @@ -481,6 +482,13 @@ public class JetTestUtils { LazyResolveTestUtil.resolve(environment.getProject(), jetFiles, environment); } + public static void assertEqualsToFile(@NotNull File expectedFile, @NotNull Editor editor) { + String actualText = editor.getDocument().getText(); + String afterText = new StringBuilder(actualText).insert(editor.getCaretModel().getOffset(), "").toString(); + + assertEqualsToFile(expectedFile, afterText); + } + public static void assertEqualsToFile(@NotNull File expectedFile, @NotNull String actual) { assertEqualsToFile(expectedFile, actual, new Function1() { @Override diff --git a/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/DirectiveBasedActionUtils.kt b/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/DirectiveBasedActionUtils.kt index c4a6d4c7770..748c53a5e55 100644 --- a/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/DirectiveBasedActionUtils.kt +++ b/idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/DirectiveBasedActionUtils.kt @@ -20,8 +20,8 @@ import com.intellij.codeInsight.intention.IntentionAction import com.intellij.psi.PsiFile import com.intellij.testFramework.UsefulTestCase import org.jetbrains.kotlin.diagnostics.Severity +import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages import org.jetbrains.kotlin.idea.caches.resolve.analyzeFully -import org.jetbrains.kotlin.idea.highlighter.IdeErrorMessages import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.test.InTextDirectivesUtils @@ -35,7 +35,7 @@ public object DirectiveBasedActionUtils { val actualErrors = file.analyzeFully().getDiagnostics() .filter { it.getSeverity() == Severity.ERROR } - .map { IdeErrorMessages.render(it) } + .map { DefaultErrorMessages.render(it).replace("\n", "
") } .sorted() UsefulTestCase.assertOrderedEquals("All actual errors should be mentioned in test data with // ERROR: directive. But no unnecessary errors should be me mentioned", diff --git a/idea/testData/intentions/addNameToArgument/ambiguousCall.kt b/idea/testData/intentions/addNameToArgument/ambiguousCall.kt index 93340866822..4319f1a9487 100644 --- a/idea/testData/intentions/addNameToArgument/ambiguousCall.kt +++ b/idea/testData/intentions/addNameToArgument/ambiguousCall.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: None of the following functions can be called with the arguments supplied. +// ERROR: None of the following functions can be called with the arguments supplied:
public fun foo(s: kotlin.String, b: kotlin.Boolean, c: kotlin.Char): kotlin.Unit defined in root package
public fun foo(s: kotlin.String, b: kotlin.Boolean, p: kotlin.Int): kotlin.Unit defined in root package fun foo(s: String, b: Boolean, p: Int){} fun foo(s: String, b: Boolean, c: Char){} diff --git a/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt b/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt index 1325e4988ef..1f5ac0de4f2 100644 --- a/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt +++ b/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt @@ -1,6 +1,6 @@ // WITH_RUNTIME // IS_APPLICABLE: false -// ERROR: Type mismatch.
Required:kotlin.Boolean
Found:kotlin.Int
+// ERROR: Type mismatch: inferred type is kotlin.Int but kotlin.Boolean was expected // ERROR: Condition must be of type kotlin.Boolean, but is of type kotlin.Int // ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use ?.-qualified call instead diff --git a/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt b/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt index 7d107ecb6c6..f348030d0ca 100644 --- a/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt +++ b/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: Type mismatch.
Required:kotlin.Boolean
Found:kotlin.Int
+// ERROR: Type mismatch: inferred type is kotlin.Int but kotlin.Boolean was expected // ERROR: Condition must be of type kotlin.Boolean, but is of type kotlin.Int // ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use ?.-qualified call instead diff --git a/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt b/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt index 00134f305af..eb9f7930b42 100644 --- a/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt +++ b/idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: false // WITH_RUNTIME -// ERROR: None of the following functions can be called with the arguments supplied. +// ERROR: None of the following functions can be called with the arguments supplied:
public fun assert(value: kotlin.Boolean): kotlin.Unit defined in kotlin
public inline fun assert(value: kotlin.Boolean, lazyMessage: () -> kotlin.Any): kotlin.Unit defined in kotlin
@kotlin.Deprecated public fun assert(value: kotlin.Boolean, message: kotlin.Any = ...): kotlin.Unit defined in kotlin fun foo() { assert() diff --git a/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt b/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt index cef7089e603..cea995f1316 100644 --- a/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt +++ b/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin fun foo(a: Boolean, b: Boolean) : Boolean { return !(!a + b) } diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt b/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt index d1980a66223..56ca742bcb4 100644 --- a/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt @@ -1,5 +1,5 @@ // IS_AVAILABLE: true -// ERROR: None of the following functions can be called with the arguments supplied.
  • bar(Int = ..., (Int) → Int) defined in root package
  • bar(Int, Int, (Int) → Int) defined in root package
+// ERROR: None of the following functions can be called with the arguments supplied:
public fun bar(a: kotlin.Int = ..., f: (kotlin.Int) -> kotlin.Int): kotlin.Unit defined in root package
public fun bar(a: kotlin.Int, b: kotlin.Int, f: (kotlin.Int) -> kotlin.Int): kotlin.Unit defined in root package // ERROR: Unresolved reference: it fun foo() { diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt.after b/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt.after index 4582e73279d..13d7aa7a8ed 100644 --- a/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt.after +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/ambigousOverload.kt.after @@ -1,5 +1,5 @@ // IS_AVAILABLE: true -// ERROR: None of the following functions can be called with the arguments supplied.
  • bar(Int = ..., (Int) → Int) defined in root package
  • bar(Int, Int, (Int) → Int) defined in root package
+// ERROR: None of the following functions can be called with the arguments supplied:
public fun bar(a: kotlin.Int = ..., f: (kotlin.Int) -> kotlin.Int): kotlin.Unit defined in root package
public fun bar(a: kotlin.Int, b: kotlin.Int, f: (kotlin.Int) -> kotlin.Int): kotlin.Unit defined in root package // ERROR: Unresolved reference: it fun foo() { diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt b/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt index f03fd2148c4..904674a4ba6 100644 --- a/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: true -// ERROR: Type mismatch.
Required:kotlin.Int
Found:() → ???
+// ERROR: Type mismatch: inferred type is () -> ??? but kotlin.Int was expected // ERROR: No value passed for parameter b // ERROR: Unresolved reference: it fun foo() { diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt.after b/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt.after index 4824cdb8676..4efb257592b 100644 --- a/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt.after +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt.after @@ -1,9 +1,9 @@ // IS_APPLICABLE: true -// ERROR: Type mismatch.
Required:kotlin.Int
Found:() → ???
+// ERROR: Type mismatch: inferred type is () -> ??? but kotlin.Int was expected // ERROR: No value passed for parameter b // ERROR: Unresolved reference: it fun foo() { - bar { it } + bar { it } } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/removeExplicitSuperQualifier/IncompleteCallAmbiguous.kt b/idea/testData/intentions/removeExplicitSuperQualifier/IncompleteCallAmbiguous.kt index 911c443a736..45ba7dd11b5 100644 --- a/idea/testData/intentions/removeExplicitSuperQualifier/IncompleteCallAmbiguous.kt +++ b/idea/testData/intentions/removeExplicitSuperQualifier/IncompleteCallAmbiguous.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: None of the following functions can be called with the arguments supplied.
  • foo(Int) defined in B
  • foo(String) defined in B
+// ERROR: None of the following functions can be called with the arguments supplied:
public final fun foo(p: kotlin.Int): kotlin.Unit defined in B
public open fun foo(p: kotlin.String): kotlin.Unit defined in B open class B { open fun foo(p: String){} diff --git a/idea/testData/intentions/specifyTypeExplicitly/publicMember.kt b/idea/testData/intentions/specifyTypeExplicitly/publicMember.kt index 4286e2c8dfc..0fedb8070f7 100644 --- a/idea/testData/intentions/specifyTypeExplicitly/publicMember.kt +++ b/idea/testData/intentions/specifyTypeExplicitly/publicMember.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: false // WITH_RUNTIME -// ERROR: Type mismatch.
Required:kotlin.Unit
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but kotlin.Unit was expected class A { public fun foo() { diff --git a/idea/testData/quickfix/abstract/manyImpl.kt b/idea/testData/quickfix/abstract/manyImpl.kt index 8a1106421b4..31abaa482ab 100644 --- a/idea/testData/quickfix/abstract/manyImpl.kt +++ b/idea/testData/quickfix/abstract/manyImpl.kt @@ -1,5 +1,5 @@ // "Make 'A' abstract" "false" -// ERROR: Class 'X' must override public open fun foo(): kotlin.Unit defined in X
because it inherits many implementations of it +// ERROR: Class 'X' must override public open fun foo(): kotlin.Unit defined in X because it inherits many implementations of it // ACTION: Create test // ACTION: Make internal // ACTION: Make private diff --git a/idea/testData/quickfix/addGenericUpperBound/boundAlreadyExists.kt b/idea/testData/quickfix/addGenericUpperBound/boundAlreadyExists.kt index 42f1060232d..8a1878ddafe 100644 --- a/idea/testData/quickfix/addGenericUpperBound/boundAlreadyExists.kt +++ b/idea/testData/quickfix/addGenericUpperBound/boundAlreadyExists.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddGenericUpperBoundFix" "false" -// ERROR: Type argument is not within its bounds.
Expected:kotlin.Any
Found:E
+// ERROR: Type argument is not within its bounds: should be subtype of 'kotlin.Any' fun foo() = 1 diff --git a/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt b/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt index 536314e583b..93dac81f54f 100644 --- a/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt +++ b/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt @@ -1,5 +1,5 @@ // "Add 'kotlin.Any' as upper bound for E" "true" -// ERROR: Type parameter bound for U in
fun <T : kotlin.Any, U : kotlin.Any> foo(x: T,y: U): kotlin.Int
is not satisfied: inferred type F is not a subtype of kotlin.Any +// ERROR: Type parameter bound for U in fun foo(x: T, y: U): kotlin.Int
is not satisfied: inferred type F is not a subtype of kotlin.Any fun foo(x: T, y: U) = 1 diff --git a/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt.after b/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt.after index c011a098a06..bdda2a29111 100644 --- a/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt.after +++ b/idea/testData/quickfix/addGenericUpperBound/inferenceTwoParams.kt.after @@ -1,5 +1,5 @@ // "Add 'kotlin.Any' as upper bound for E" "true" -// ERROR: Type parameter bound for U in
fun <T : kotlin.Any, U : kotlin.Any> foo(x: T,y: U): kotlin.Int
is not satisfied: inferred type F is not a subtype of kotlin.Any +// ERROR: Type parameter bound for U in fun foo(x: T, y: U): kotlin.Int
is not satisfied: inferred type F is not a subtype of kotlin.Any fun foo(x: T, y: U) = 1 diff --git a/idea/testData/quickfix/anonymousObject.kt b/idea/testData/quickfix/anonymousObject.kt index 2143b9d6371..303a387fb31 100644 --- a/idea/testData/quickfix/anonymousObject.kt +++ b/idea/testData/quickfix/anonymousObject.kt @@ -1,7 +1,7 @@ // "Make 'object : T {}' abstract" "false" // ACTION: Implement members // ACTION: Split property declaration -// ERROR: Object must be declared abstract or implement abstract member
public abstract fun foo(): kotlin.Unit defined in T +// ERROR: Object must be declared abstract or implement abstract member public abstract fun foo(): kotlin.Unit defined in T interface T { fun foo() } diff --git a/idea/testData/quickfix/autoImports/minusOperator.after.kt b/idea/testData/quickfix/autoImports/minusOperator.after.kt index cd1aa02b96c..aa150697b96 100644 --- a/idea/testData/quickfix/autoImports/minusOperator.after.kt +++ b/idea/testData/quickfix/autoImports/minusOperator.after.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun kotlin.String.minus(i: java.lang.Integer): kotlin.String defined in h
  • public fun kotlin.String.minus(str: kotlin.String): kotlin.String defined in h
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun kotlin.String.minus(i: java.lang.Integer): kotlin.String defined in h
public fun kotlin.String.minus(str: kotlin.String): kotlin.String defined in h package h @@ -8,7 +8,7 @@ import util.minus interface H fun f(h: H?) { - h - "other" + h - "other" } diff --git a/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt index a2e861be294..26da1d16d1f 100644 --- a/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt +++ b/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun kotlin.String.minus(i: java.lang.Integer): kotlin.String defined in h
  • public fun kotlin.String.minus(str: kotlin.String): kotlin.String defined in h
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public fun kotlin.String.minus(i: java.lang.Integer): kotlin.String defined in h
public fun kotlin.String.minus(str: kotlin.String): kotlin.String defined in h package h diff --git a/idea/testData/quickfix/autoImports/operatorAssignPlus.test b/idea/testData/quickfix/autoImports/operatorAssignPlus.test index dde65a0dfdc..db97e003aab 100644 --- a/idea/testData/quickfix/autoImports/operatorAssignPlus.test +++ b/idea/testData/quickfix/autoImports/operatorAssignPlus.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package testing @@ -23,7 +23,7 @@ operator fun Some.plus(i: Int) : Some = this // FILE: first.after.kt // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package testing diff --git a/idea/testData/quickfix/autoImports/operatorAssignPlusAssign.test b/idea/testData/quickfix/autoImports/operatorAssignPlusAssign.test index 5daeb1d6b9e..8546f6f6be7 100644 --- a/idea/testData/quickfix/autoImports/operatorAssignPlusAssign.test +++ b/idea/testData/quickfix/autoImports/operatorAssignPlusAssign.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package testing @@ -23,7 +23,7 @@ operator fun Some.plusAssign(i: Int) {} // FILE: first.after.kt // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package testing diff --git a/idea/testData/quickfix/autoImports/operatorAssignPlusTwoVariantsDifferentPackages.test b/idea/testData/quickfix/autoImports/operatorAssignPlusTwoVariantsDifferentPackages.test index 7cb39042416..4db7761fec4 100644 --- a/idea/testData/quickfix/autoImports/operatorAssignPlusTwoVariantsDifferentPackages.test +++ b/idea/testData/quickfix/autoImports/operatorAssignPlusTwoVariantsDifferentPackages.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package testing @@ -31,7 +31,7 @@ operator fun Some.plus(i: Int) : Some = this // FILE: first.after.kt // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package testing diff --git a/idea/testData/quickfix/autoImports/plusOperator.after.kt b/idea/testData/quickfix/autoImports/plusOperator.after.kt index 551b72e86c6..05cf55eb2a2 100644 --- a/idea/testData/quickfix/autoImports/plusOperator.after.kt +++ b/idea/testData/quickfix/autoImports/plusOperator.after.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package h @@ -8,5 +8,5 @@ import util.plus interface H fun f(h: H?) { - h + "other" + h + "other" } \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt index ed96dd2c9da..54c748ce7a5 100644 --- a/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt +++ b/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin package h diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt index 437fd4d0e50..0c8301cb8ac 100644 --- a/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun h.A.unaryPlus(): kotlin.Int defined in h
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun h.A.unaryPlus(): kotlin.Int defined in h package h @@ -8,7 +8,7 @@ import util.unaryPlus interface H fun f(h: H?) { - +h + +h } class A() diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt index db9b7d69be2..1402dced7ff 100644 --- a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun h.A.unaryPlus(): kotlin.Int defined in h
+// ERROR: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun h.A.unaryPlus(): kotlin.Int defined in h package h diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt index 1069a5f6014..a7450449efc 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Class 'Foo' must be declared abstract or implement abstract member
public abstract operator fun getValue(thisRef: A<T>, property: kotlin.reflect.KProperty<*>): B defined in kotlin.properties.ReadOnlyProperty +// ERROR: Class 'Foo' must be declared abstract or implement abstract member public abstract operator fun getValue(thisRef: A, property: kotlin.reflect.KProperty<*>): B defined in kotlin.properties.ReadOnlyProperty open class B diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after index bb06b8bc864..4470e6171ee 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after @@ -1,7 +1,7 @@ import kotlin.properties.ReadOnlyProperty // "Create class 'Foo'" "true" -// ERROR: Class 'Foo' must be declared abstract or implement abstract member
public abstract operator fun getValue(thisRef: A<T>, property: kotlin.reflect.KProperty<*>): B defined in kotlin.properties.ReadOnlyProperty +// ERROR: Class 'Foo' must be declared abstract or implement abstract member public abstract operator fun getValue(thisRef: A, property: kotlin.reflect.KProperty<*>): B defined in kotlin.properties.ReadOnlyProperty open class B diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt index edb9cd4048a..198774ea4f5 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt @@ -1,6 +1,6 @@ // "Create class 'Foo'" "true" -// ERROR: Type inference failed:
constructor Foo<U>(u: U)
cannot be applied to
(U)
-// ERROR: Type mismatch.
Required:U
Found:U
+// ERROR: Type inference failed: constructor Foo(u: U)
cannot be applied to
(U)
+// ERROR: Type mismatch: inferred type is U but U was expected class A(val n: T) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt.after b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt.after index cff0b5de0f6..ecd7d02b779 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt.after +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithGenericReceiver.kt.after @@ -1,6 +1,6 @@ // "Create class 'Foo'" "true" -// ERROR: Type inference failed:
constructor Foo<U>(u: U)
cannot be applied to
(U)
-// ERROR: Type mismatch.
Required:U
Found:U
+// ERROR: Type inference failed: constructor Foo(u: U)
cannot be applied to
(U)
+// ERROR: Type mismatch: inferred type is U but U was expected class A(val n: T) { inner class Foo(u: U) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt index f0b172f3b87..ae55ea9616b 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Type mismatch.
Required:V
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but V was expected // ERROR: The integer literal does not conform to the expected type U class B(val t: T) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt.after b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt.after index 1b8fbbb96f8..1f8d5d9752f 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt.after +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInner.kt.after @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Type mismatch.
Required:V
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but V was expected // ERROR: The integer literal does not conform to the expected type U class B(val t: T) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt index ad1bf45241e..9d69393bde4 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Type mismatch.
Required:U
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but U was expected class B(val t: T) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt.after b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt.after index f528b2c5885..d20624d1cea 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt.after +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerPartialSubstitution.kt.after @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Type mismatch.
Required:U
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but U was expected class B(val t: T) { inner class Foo(i: Int, u: U) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt index 75d37afd310..57f3b88faff 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Type mismatch.
Required:W
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but W was expected // ERROR: The integer literal does not conform to the expected type V class B(val t: T) { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt.after b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt.after index df3ea11fa39..d203d564041 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt.after +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/typeArguments/classMemberInnerWithReceiverArg.kt.after @@ -1,5 +1,5 @@ // "Create class 'Foo'" "true" -// ERROR: Type mismatch.
Required:W
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but W was expected // ERROR: The integer literal does not conform to the expected type V class B(val t: T) { diff --git a/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt b/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt index 9e19bb62dfb..05f3ade49ca 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt @@ -1,5 +1,5 @@ // "Create member function 'foo'" "true" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:A<kotlin.Int>
+// ERROR: Type mismatch: inferred type is A but kotlin.Int was expected class A(val n: T) diff --git a/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt.after b/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt.after index d6d408da0c4..70c538d1440 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt.after +++ b/idea/testData/quickfix/createFromUsage/createFunction/call/inconsistentTypes.kt.after @@ -1,5 +1,5 @@ // "Create member function 'foo'" "true" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:A<kotlin.Int>
+// ERROR: Type mismatch: inferred type is A but kotlin.Int was expected class A(val n: T) { fun foo(s: String, t: T): Any { diff --git a/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/wrongExpectedType.kt b/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/wrongExpectedType.kt index 2f85ff49059..903b128a3de 100644 --- a/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/wrongExpectedType.kt +++ b/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/wrongExpectedType.kt @@ -2,7 +2,7 @@ // ACTION: Add parameter to constructor 'A' // ACTION: Change 'b' type to 'A' // ACTION: Create function 'A' -// ERROR: Type mismatch.
Required:B
Found:A
+// ERROR: Type mismatch: inferred type is A but B was expected // ERROR: Too many arguments for public constructor A() defined in A class A diff --git a/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt b/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt index 67c988213bf..a2f8b0b1224 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt @@ -1,5 +1,5 @@ // "Create member property 'foo'" "true" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:A<kotlin.Int>
+// ERROR: Type mismatch: inferred type is A but kotlin.Int was expected // ERROR: Property must be initialized or be abstract class A(val n: T) diff --git a/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt.after b/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt.after index 7fe56980ff8..ec7436268a2 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt.after +++ b/idea/testData/quickfix/createFromUsage/createVariable/property/inconsistentTypes.kt.after @@ -1,5 +1,5 @@ // "Create member property 'foo'" "true" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:A<kotlin.Int>
+// ERROR: Type mismatch: inferred type is A but kotlin.Int was expected // ERROR: Property must be initialized or be abstract class A(val n: T) { diff --git a/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt b/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt index dc60b8d9399..373d108f3df 100644 --- a/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt +++ b/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt @@ -1,5 +1,5 @@ // "Insert 'this()' call" "true" -// ERROR: None of the following functions can be called with the arguments supplied.
  • (Int) defined in A
  • (String) defined in A
+// ERROR: None of the following functions can be called with the arguments supplied:
public constructor A(x: kotlin.Int) defined in A
public constructor A(x: kotlin.String) defined in A class A(val x: Int) { constructor(x: String) diff --git a/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt.after b/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt.after index 6c8c77c300b..a119f15997e 100644 --- a/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt.after +++ b/idea/testData/quickfix/insertDelegationCall/primaryRequiredWithParameter.kt.after @@ -1,5 +1,5 @@ // "Insert 'this()' call" "true" -// ERROR: None of the following functions can be called with the arguments supplied.
  • (Int) defined in A
  • (String) defined in A
+// ERROR: None of the following functions can be called with the arguments supplied:
public constructor A(x: kotlin.Int) defined in A
public constructor A(x: kotlin.String) defined in A class A(val x: Int) { constructor(x: String) : this() diff --git a/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt b/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt index 92fdf91fb81..d20413a10f6 100644 --- a/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt +++ b/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt @@ -1,5 +1,5 @@ // "Change function signature..." "true" -// ERROR: Class 'B' must be declared abstract or implement abstract member
public abstract fun f(a: kotlin.String): kotlin.Unit defined in A +// ERROR: Class 'B' must be declared abstract or implement abstract member public abstract fun f(a: kotlin.String): kotlin.Unit defined in A interface A { fun f(a: Int) fun f(a: String) diff --git a/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt.after b/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt.after index a0d0c1bb67b..1420715f3ba 100644 --- a/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt.after +++ b/idea/testData/quickfix/override/nothingToOverride/addParameterMultiple.kt.after @@ -1,5 +1,5 @@ // "Change function signature..." "true" -// ERROR: Class 'B' must be declared abstract or implement abstract member
public abstract fun f(a: kotlin.String): kotlin.Unit defined in A +// ERROR: Class 'B' must be declared abstract or implement abstract member public abstract fun f(a: kotlin.String): kotlin.Unit defined in A interface A { fun f(a: Int) fun f(a: String) diff --git a/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt b/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt index 210a7d79fdf..27586d3bd10 100644 --- a/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt +++ b/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt @@ -1,5 +1,5 @@ // "Change function signature to 'fun f(a: Int): Int'" "true" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but kotlin.Int was expected open class A { open fun f(a: Int): Int = 0 } diff --git a/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt.after b/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt.after index 086f245a6c7..b5529cc6b12 100644 --- a/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt.after +++ b/idea/testData/quickfix/override/nothingToOverride/changeReturnType.kt.after @@ -1,5 +1,5 @@ // "Change function signature to 'fun f(a: Int): Int'" "true" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but kotlin.Int was expected open class A { open fun f(a: Int): Int = 0 } diff --git a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeMultipleOverriddenPropertiesTypes.kt b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeMultipleOverriddenPropertiesTypes.kt index 9ade4150f35..c70bd46cb9d 100644 --- a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeMultipleOverriddenPropertiesTypes.kt +++ b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeMultipleOverriddenPropertiesTypes.kt @@ -1,6 +1,6 @@ // "Change 'A.x' type to '(Int) -> Int'" "false" // ACTION: Change 'C.x' type to '(String) -> Int' -// ERROR: Return type is '(kotlin.Int) → kotlin.Int', which is not a subtype of overridden
public abstract val x: (kotlin.String) → kotlin.Int defined in A +// ERROR: Return type of 'x' is not a subtype of the return type of the overridden member 'public abstract val x: (kotlin.String) -> kotlin.Int defined in A' interface A { val x: (String) -> Int } diff --git a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeOverriddenPropertyTypeToMatchOverridingProperty.kt b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeOverriddenPropertyTypeToMatchOverridingProperty.kt index cac7ada2013..9e1f978fa6f 100644 --- a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeOverriddenPropertyTypeToMatchOverridingProperty.kt +++ b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeOverriddenPropertyTypeToMatchOverridingProperty.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.ChangeVariableTypeFix" "false" -// ERROR: Var-property type is 'kotlin.String', which is not a type of overridden
public abstract var x: kotlin.Int defined in A +// ERROR: Type of 'x' doesn't match the type of the overridden var-property 'public abstract var x: kotlin.Int defined in A' interface A { var x: Int } diff --git a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangePropertyTypeToMatchOverridenProperties.kt b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangePropertyTypeToMatchOverridenProperties.kt index 3968a19c0f8..36afd0cf323 100644 --- a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangePropertyTypeToMatchOverridenProperties.kt +++ b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangePropertyTypeToMatchOverridenProperties.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.ChangeVariableTypeFix" "false" -// ERROR: Var-property type is 'kotlin.Int', which is not a type of overridden
public abstract var x: kotlin.String defined in A +// ERROR: Type of 'x' doesn't match the type of the overridden var-property 'public abstract var x: kotlin.String defined in A' interface A { var x: String } diff --git a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeReturnTypeOfOverriddenFunction.kt b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeReturnTypeOfOverriddenFunction.kt index d4b5576a195..2a5f1080b01 100644 --- a/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeReturnTypeOfOverriddenFunction.kt +++ b/idea/testData/quickfix/override/typeMismatchOnOverride/cantChangeReturnTypeOfOverriddenFunction.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.ChangeFunctionReturnTypeFix" "false" -// ERROR: Return type is 'kotlin.Long', which is not a subtype of overridden
public abstract fun foo(): kotlin.Int defined in A +// ERROR: Return type of 'foo' is not a subtype of the return type of the overridden member 'public abstract fun foo(): kotlin.Int defined in A' interface A { fun foo(): Int } diff --git a/idea/testData/quickfix/override/typeMismatchOnOverride/returnTypeMismatchOnMultipleOverrideAmbiguity.kt b/idea/testData/quickfix/override/typeMismatchOnOverride/returnTypeMismatchOnMultipleOverrideAmbiguity.kt index 444b07b23d7..6b952efc236 100644 --- a/idea/testData/quickfix/override/typeMismatchOnOverride/returnTypeMismatchOnMultipleOverrideAmbiguity.kt +++ b/idea/testData/quickfix/override/typeMismatchOnOverride/returnTypeMismatchOnMultipleOverrideAmbiguity.kt @@ -1,7 +1,7 @@ // "Change 'B.foo' function return type to 'Int'" "false" // "Change 'B.foo' function return type to 'Long'" "false" // "Remove explicitly specified return type" "false" -// ERROR: Return type is 'kotlin.String', which is not a subtype of overridden
public abstract fun foo(): kotlin.Int defined in A +// ERROR: Return type of 'foo' is not a subtype of the return type of the overridden member 'public abstract fun foo(): kotlin.Int defined in A' abstract class A { abstract fun foo() : Int; } diff --git a/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt b/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt index e8322744a06..6da549b4b59 100644 --- a/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt +++ b/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt @@ -1,6 +1,6 @@ // "Add non-null asserted (!!) call" "false" // ACTION: Change parameter 's' type of function 'other' to 'String?' -// ERROR: ype mismatch.
Required:kotlin.Int
Found:kotlin.String?
+// ERROR: Type mismatch: inferred type is kotlin.String? but kotlin.Int was expected fun test() { val s: String? = "" other(s) diff --git a/idea/testData/quickfix/typeMismatch/casts/typeMismatch2.kt b/idea/testData/quickfix/typeMismatch/casts/typeMismatch2.kt index b9dd6d1c242..e276811974b 100644 --- a/idea/testData/quickfix/typeMismatch/casts/typeMismatch2.kt +++ b/idea/testData/quickfix/typeMismatch/casts/typeMismatch2.kt @@ -1,6 +1,6 @@ // "Cast expression 'Foo()' to 'Foo'" "false" // ACTION: Create test -// ERROR: Type mismatch.
Required:Foo<kotlin.Int>
Found:Foo<kotlin.Number>
+// ERROR: Type mismatch: inferred type is Foo but Foo was expected class Foo fun foo(): Foo { diff --git a/idea/testData/quickfix/typeMismatch/casts/typeMismatch4.kt b/idea/testData/quickfix/typeMismatch/casts/typeMismatch4.kt index 1e1da653a89..0a4cbc423e6 100644 --- a/idea/testData/quickfix/typeMismatch/casts/typeMismatch4.kt +++ b/idea/testData/quickfix/typeMismatch/casts/typeMismatch4.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.CastExpressionFix" "false" -// ERROR: Type mismatch.
Required:B
Found:A
+// ERROR: Type mismatch: inferred type is A but B was expected open class A class B : A() diff --git a/idea/testData/quickfix/typeMismatch/dontChangeOverriddenPropertyTypeToErrorType.kt b/idea/testData/quickfix/typeMismatch/dontChangeOverriddenPropertyTypeToErrorType.kt index 753ae956121..06646913c1d 100644 --- a/idea/testData/quickfix/typeMismatch/dontChangeOverriddenPropertyTypeToErrorType.kt +++ b/idea/testData/quickfix/typeMismatch/dontChangeOverriddenPropertyTypeToErrorType.kt @@ -1,6 +1,6 @@ // "Change 'B.x' type to '(String) -> [ERROR : Ay]'" "false" // ACTION: Change 'A.x' type to '(Int) -> Int' -// ERROR: Return type is '(kotlin.Int) → kotlin.Int', which is not a subtype of overridden
public abstract val x: (kotlin.String) → [ERROR : Ay] defined in A +// ERROR: Return type of 'x' is not a subtype of the return type of the overridden member 'public abstract val x: (kotlin.String) -> [ERROR : Ay] defined in A' // ERROR: Unresolved reference: Ay interface A { val x: (String) -> Ay diff --git a/idea/testData/quickfix/typeMismatch/parameterTypeMismatch/multiFakeOverride.kt b/idea/testData/quickfix/typeMismatch/parameterTypeMismatch/multiFakeOverride.kt index dc9ee242b1d..7c50e9d07eb 100644 --- a/idea/testData/quickfix/typeMismatch/parameterTypeMismatch/multiFakeOverride.kt +++ b/idea/testData/quickfix/typeMismatch/parameterTypeMismatch/multiFakeOverride.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.ChangeParameterTypeFix" "false" -// ERROR: Type mismatch.
Required:kotlin.Int
Found:kotlin.String
+// ERROR: Type mismatch: inferred type is kotlin.String but kotlin.Int was expected interface A { fun f(i: Int): Boolean } diff --git a/idea/testData/quickfix/typeMismatch/tooManyArgumentsException.kt b/idea/testData/quickfix/typeMismatch/tooManyArgumentsException.kt index 16b7dfc01b8..12ca0e54226 100644 --- a/idea/testData/quickfix/typeMismatch/tooManyArgumentsException.kt +++ b/idea/testData/quickfix/typeMismatch/tooManyArgumentsException.kt @@ -1,5 +1,5 @@ // "???" "false" -//ERROR: Type mismatch.
Required:kotlin.Array<out kotlin.String>
Found:kotlin.Array<out kotlin.Int>
+//ERROR: Type mismatch: inferred type is kotlin.Array but kotlin.Array was expected //this test checks that there is no ArrayIndexOutOfBoundsException when there are more arguments than parameters fun array1(vararg a : T) = a diff --git a/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/dontChangeFunctionReturnTypeToErrorType.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/dontChangeFunctionReturnTypeToErrorType.kt index f2876c47d15..19b6bd74d55 100644 --- a/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/dontChangeFunctionReturnTypeToErrorType.kt +++ b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/dontChangeFunctionReturnTypeToErrorType.kt @@ -4,7 +4,7 @@ // ACTION: Create enum 'NoSuchType' // ACTION: Create interface 'NoSuchType' // ACTION: Remove explicit lambda parameter types (may break code) -// ERROR: Type mismatch.
Required:kotlin.Int
Found:([ERROR : NoSuchType]) → kotlin.Int
+// ERROR: Type mismatch: inferred type is ([ERROR : NoSuchType]) -> kotlin.Int but kotlin.Int was expected // ERROR: Unresolved reference: NoSuchType fun foo(): Int { diff --git a/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverride.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverride.kt index 253d8ff05c5..f997cc8f230 100644 --- a/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverride.kt +++ b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverride.kt @@ -1,7 +1,7 @@ // "Change 'AA.f' function return type to 'Boolean'" "false" // ACTION: Change 'AAA.g' function return type to 'Int' // ACTION: Convert to expression body -// ERROR: Type mismatch.
Required:kotlin.Boolean
Found:kotlin.Int
+// ERROR: Type mismatch: inferred type is kotlin.Int but kotlin.Boolean was expected interface A { fun f(): Int } diff --git a/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverrideForOperatorConvention.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverrideForOperatorConvention.kt index 8d524c25dd5..e29145d5232 100644 --- a/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverrideForOperatorConvention.kt +++ b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/multiFakeOverrideForOperatorConvention.kt @@ -2,7 +2,7 @@ // ACTION: Change 'AAA.g' function return type to 'Boolean' // ACTION: Convert to expression body // ACTION: Replace overloaded operator with function call -// ERROR: Type mismatch.
Required:kotlin.Int
Found:kotlin.Boolean
+// ERROR: Type mismatch: inferred type is kotlin.Boolean but kotlin.Int was expected interface A { fun contains(i: Int): Boolean } diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java index a4cee0afc8e..76c567e67f7 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java @@ -37,7 +37,9 @@ import org.jetbrains.kotlin.idea.test.PluginTestCaseBase; import org.jetbrains.kotlin.idea.util.application.ApplicationUtilsKt; import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.test.InTextDirectivesUtils; +import org.jetbrains.kotlin.test.JetTestUtils; import org.junit.Assert; +import org.junit.ComparisonFailure; import java.io.File; import java.util.ArrayList; @@ -172,7 +174,12 @@ public abstract class AbstractIntentionTest extends KotlinCodeInsightTestCase { myFile = entry.getValue(); String canonicalPathToExpectedFile = PathUtil.getCanonicalPath(entry.getKey() + ".after"); - checkResultByFile(canonicalPathToExpectedFile); + try { + checkResultByFile(canonicalPathToExpectedFile); + } + catch (ComparisonFailure e) { + JetTestUtils.assertEqualsToFile(new File(canonicalPathToExpectedFile), getEditor()); + } } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.java index f14dd074120..86a1ce7ba60 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.java @@ -276,7 +276,13 @@ public abstract class AbstractQuickFixMultiFileTest extends KotlinDaemonAnalyzer doAction(text, actionShouldBeAvailable, beforeFileName); if (actionShouldBeAvailable) { - checkResultByFile(beforeFileName.replace(".before.Main.", ".after.")); + String afterFilePath = beforeFileName.replace(".before.Main.", ".after."); + try { + checkResultByFile(afterFilePath); + } + catch (ComparisonFailure e) { + JetTestUtils.assertEqualsToFile(new File(afterFilePath), getEditor()); + } PsiFile mainFile = myFile; String mainFileName = mainFile.getName(); @@ -293,7 +299,9 @@ public abstract class AbstractQuickFixMultiFileTest extends KotlinDaemonAnalyzer if (e.getMessage().startsWith("Cannot find file")) { checkResultByFile(extraFileFullPath); } - else throw e; + else { + throw e; + } } } } @@ -301,6 +309,9 @@ public abstract class AbstractQuickFixMultiFileTest extends KotlinDaemonAnalyzer catch (ComparisonFailure e) { throw e; } + catch (AssertionError e) { + throw e; + } catch (Throwable e) { e.printStackTrace(); fail(getTestName(true)); diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java index 189eb96b264..b0e7dd2a8cd 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java @@ -32,6 +32,7 @@ import com.intellij.refactoring.util.CanonicalTypes; import com.intellij.refactoring.util.CommonRefactoringUtil; import com.intellij.util.ArrayUtil; import com.intellij.util.VisibilityUtil; +import junit.framework.ComparisonFailure; import kotlin.ArraysKt; import kotlin.CollectionsKt; import kotlin.SetsKt; @@ -55,6 +56,7 @@ import org.jetbrains.kotlin.resolve.dataClassUtils.DataClassUtilsKt; import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform; import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode; import org.jetbrains.kotlin.test.InTextDirectivesUtils; +import org.jetbrains.kotlin.test.JetTestUtils; import java.io.File; import java.util.*; @@ -1479,7 +1481,13 @@ public class JetChangeSignatureTest extends KotlinCodeInsightTestCase { for (Editor editor : editors) { setActiveEditor(editor); PsiFile currentFile = getFile(); - checkResultByFile(currentFile.getName().replace("Before.", "After.")); + String afterFilePath = currentFile.getName().replace("Before.", "After."); + try { + checkResultByFile(afterFilePath); + } + catch (ComparisonFailure e) { + JetTestUtils.assertEqualsToFile(new File(afterFilePath), getEditor()); + } if (checkErrorsAfter && currentFile instanceof KtFile) { DirectiveBasedActionUtils.INSTANCE$.checkForUnexpectedErrors((KtFile) currentFile); }