diff --git a/compiler/testData/codegen/box/secondaryConstructors/accessToCompanion.kt b/compiler/testData/codegen/box/secondaryConstructors/accessToCompanion.kt index 639fcf57ace..0c9e1d2df2e 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/accessToCompanion.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/accessToCompanion.kt @@ -4,8 +4,6 @@ internal class A(val result: Int) { val prop = 2 val C = 3 } - object C { - } constructor() : this(foo() + prop + C) } diff --git a/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt b/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt index 26cf5014740..05fe3b86163 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt @@ -15,7 +15,7 @@ operator fun String.unaryPlus(): Int = 0 fun test() { requireInt(+ "") requireInt(+ Example()) - requireString(+ ExampleDeprecated()) + requireString(+ ExampleDeprecated()) } fun requireInt(n: Int) {} @@ -26,7 +26,7 @@ class Example2 { operator fun minus() = this fun test() { - +this - -this + +this + -this } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/FreeFunctionCalledAsExtension.kt b/compiler/testData/diagnostics/tests/FreeFunctionCalledAsExtension.kt index 2d89ffd77b2..07b880ac15e 100644 --- a/compiler/testData/diagnostics/tests/FreeFunctionCalledAsExtension.kt +++ b/compiler/testData/diagnostics/tests/FreeFunctionCalledAsExtension.kt @@ -1,13 +1,13 @@ -fun foo(a: (String) -> Unit) { - "".a() +fun foo(a: (String) -> Unit) { + "".a() } interface A : (String) -> Unit {} -fun foo(a: @Extension A) { +fun foo(a: @Extension A) { // @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic. // Only kotlin.Function{n} type annotated with @Extension should - "".a() + "".a() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/Operators.kt b/compiler/testData/diagnostics/tests/Operators.kt index 53e51606b85..0575b232b00 100644 --- a/compiler/testData/diagnostics/tests/Operators.kt +++ b/compiler/testData/diagnostics/tests/Operators.kt @@ -38,7 +38,7 @@ class Example2 { public operator fun invoke() {} } -fun a() { +fun test() { var a = Example() var b = Example() var c = Example2() @@ -107,7 +107,7 @@ open class Anc : Base() { class Anc2 : Anc() -fun b() { +fun test2() { Anc() + Anc() Anc() - Anc() Anc2() + Anc2() diff --git a/compiler/testData/diagnostics/tests/Operators.txt b/compiler/testData/diagnostics/tests/Operators.txt index 83342f63570..9841dd7b485 100644 --- a/compiler/testData/diagnostics/tests/Operators.txt +++ b/compiler/testData/diagnostics/tests/Operators.txt @@ -1,7 +1,7 @@ package -public fun a(): kotlin.Unit -public fun b(): kotlin.Unit +public fun test(): kotlin.Unit +public fun test2(): kotlin.Unit public open class Anc : Base { public constructor Anc() diff --git a/compiler/testData/diagnostics/tests/RecursiveResolve.kt b/compiler/testData/diagnostics/tests/RecursiveResolve.kt index 55e44344ff8..e8a9c181957 100644 --- a/compiler/testData/diagnostics/tests/RecursiveResolve.kt +++ b/compiler/testData/diagnostics/tests/RecursiveResolve.kt @@ -32,7 +32,7 @@ class Test2(foo: Any?, bar: Any?) { class Test3(foo: Any?, bar: Any?) { val foo = foo ?: this private val bar = bar ?: this - private val bas = bas() + private val bas = bas() val bas2 = bas2() private fun bas(): Int = null!! @@ -47,7 +47,7 @@ class Test3(foo: Any?, bar: Any?) { class Test4(foo: Any?, bar: Any?) { val foo = foo ?: this private val bar = bar ?: this - private val bas = bas() + private val bas = bas() val bas2 = bas2() private fun bas(): Int = null!! diff --git a/compiler/testData/diagnostics/tests/RecursiveResolve.txt b/compiler/testData/diagnostics/tests/RecursiveResolve.txt index 1ca10ca093b..b7ee249de48 100644 --- a/compiler/testData/diagnostics/tests/RecursiveResolve.txt +++ b/compiler/testData/diagnostics/tests/RecursiveResolve.txt @@ -37,7 +37,7 @@ public final class Test2 { public final class Test3 { public constructor Test3(/*0*/ foo: kotlin.Any?, /*1*/ bar: kotlin.Any?) private final val bar: kotlin.Any - private final val bas: kotlin.Int + private final val bas: [ERROR : Type for bas()] public final val bas2: kotlin.Int public final val foo: kotlin.Any public final fun bar(): kotlin.Int @@ -54,7 +54,7 @@ public final class Test3 { public final class Test4 { public constructor Test4(/*0*/ foo: kotlin.Any?, /*1*/ bar: kotlin.Any?) private final val bar: kotlin.Any - private final val bas: kotlin.Int + private final val bas: [ERROR : Type for bas()] public final val bas2: kotlin.Int public final val foo: kotlin.Any public final fun bar(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt b/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt index 2a7f60af188..525d57ad2e8 100644 --- a/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt +++ b/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt @@ -5,7 +5,7 @@ fun foo(a : Any?) {} public fun main() { getT<*>() - ggetT<*>() + ggetT<*>() getTT<*, *>() getTT<*, Int>() getTT*>() diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt index 2c92931d6af..e676cb8a978 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt @@ -10,6 +10,6 @@ class A { } fun main() { - A::extInt - A::extA + A::extInt + A::extA } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt index b2f1b654908..41a533aaeae 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt @@ -7,7 +7,7 @@ class A { } fun A.main() { - ::Nested + ::Nested val y = A::Nested checkSubtype>(y) diff --git a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt index f4659d296b6..64914488670 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt @@ -8,5 +8,5 @@ fun main() { A::bar - B::bar + B::bar } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.kt index b1a24cb4906..5a52d59c4d3 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.kt @@ -14,15 +14,14 @@ class A { fun A.foo(): String = "A" -val x0 = A::foo // function A::foo wins by default -val userOfX0 = x0(A()) +val x0 = A::foo val x1 = ofType<(A) -> Unit>(A::foo) val x2 = ofType>(A::foo) val x3: KProperty1 = A::foo val x4: (A) -> String = A::foo -val y0 = A::bar +val y0 = A::bar val y1 = ofType<(A) -> Unit>(A::bar) val y2 = ofType>(A::bar) val y3: KProperty1 = A::bar diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.txt b/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.txt index 45efc890d7b..ce64ac94a29 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.txt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.txt @@ -1,12 +1,11 @@ package -public val userOfX0: kotlin.Unit -public val x0: kotlin.reflect.KFunction1 +public val x0: [ERROR : Type for A::foo] public val x1: (A) -> kotlin.Unit public val x2: kotlin.reflect.KProperty1 public val x3: kotlin.reflect.KProperty1 public val x4: (A) -> kotlin.String -public val y0: kotlin.reflect.KFunction1 +public val y0: [ERROR : Type for A::bar] public val y1: (A) -> kotlin.Unit public val y2: kotlin.reflect.KProperty1 public val y3: kotlin.reflect.KProperty1 diff --git a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum.kt b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum.kt index 63471ab7579..3c8b8888cfe 100644 --- a/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum.kt +++ b/compiler/testData/diagnostics/tests/classObjects/InnerClassAccessThroughEnum.kt @@ -14,12 +14,11 @@ enum class C { E4 { fun c() { - //TODO: this is a bug - this.B() + this.B() C.A() A() - //TODO: this is a bug + //TODO: should be resolved with error this.A() } }; @@ -33,7 +32,7 @@ enum class C { fun f() { C.E1.A - C.E1.A() + C.E1.A() C.E2.B() C.E2.O diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.dynamic.txt b/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.dynamic.txt index d2018ed95c6..30f540c4ee0 100644 --- a/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.dynamic.txt +++ b/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.dynamic.txt @@ -1 +1,2 @@ public final fun sam(/*0*/ p0: dynamic): dynamic +public final fun sam(/*0*/ name: dynamic, /*1*/ name: dynamic): dynamic diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.kt b/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.kt index bdb1d328c85..9f899effa0d 100644 --- a/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.kt +++ b/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.kt @@ -22,9 +22,9 @@ import p.* class K: J.C() { fun dynamic.test() { sam(null) - sam( - name = null, - name = null + sam( + name = null, + name = null ) } diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt index 71fd0ed04cb..bc020aac0a6 100644 --- a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt +++ b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt @@ -9,9 +9,12 @@ class Foo { } fun main(args: Array) { - with("", { - Foo.findByName("") - }) + with("", { + Foo.findByName("") + }) + with(Foo) { + findByName("") + } } fun with(t: T, f: T.() -> Unit) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.kt b/compiler/testData/diagnostics/tests/extensions/kt1875.kt index 83654a9d1be..f7fa2da3b4e 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.kt @@ -2,7 +2,7 @@ package kt1875 -fun f(a : Int?, b : Int.(Int)->Int) = a?.b(1) //unnecessary safe call warning +fun foo(a : Int?, b : Int.(Int)->Int) = a?.b(1) //unnecessary safe call warning interface T { val f : ((i: Int) -> Unit)? @@ -14,7 +14,7 @@ fun test(t: T) { } fun test1(t: T?) { - t.f(1) + t.f(1) // todo resolve f as value and report UNSAFE_CALL t?.f(1) t.f?.invoke(1) t?.f?.invoke(1) diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.txt b/compiler/testData/diagnostics/tests/extensions/kt1875.txt index 7dab7c3b799..4f28bc21cb1 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.txt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.txt @@ -1,7 +1,7 @@ package package kt1875 { - public fun f(/*0*/ a: kotlin.Int?, /*1*/ b: kotlin.Int.(kotlin.Int) -> kotlin.Int): kotlin.Int? + public fun foo(/*0*/ a: kotlin.Int?, /*1*/ b: kotlin.Int.(kotlin.Int) -> kotlin.Int): kotlin.Int? public fun test(/*0*/ t: kt1875.T): kotlin.Unit public fun test1(/*0*/ t: kt1875.T?): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt b/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt index d1b4b80778b..065aaebd11e 100644 --- a/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt +++ b/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt @@ -15,5 +15,5 @@ import a.X import b.* fun foo() { - X = 1 + X = 1 } diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt index 24f772375d1..d5f7005f3bf 100644 --- a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt @@ -5,8 +5,8 @@ package test import testing.other.* import testing.TestFun -// Resolve should be ambiguous -val a = TestFun() +// Resolve shouldn't be ambiguous +val a = TestFun() //FILE:testing.kt diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt index 9469993fedd..d76c08c38c3 100644 --- a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.txt @@ -1,7 +1,7 @@ package package test { - public val a: [ERROR : Type for TestFun()] + public val a: testing.TestFun } package testing { diff --git a/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.kt b/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.kt index 63dd2b4894d..d12ab66ddfd 100644 --- a/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.kt +++ b/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.kt @@ -48,17 +48,17 @@ fun test() { val ii: I.NI? = null val bc: B.NC = B.NC() - val bic: B.IC = B().IC() + val bic: B.IC = B().IC() val bi: B.NI? = null val cc: C.NC = C.NC() val ci: C.NI? = null val dc: D.NC = D.NC() - val dic: D.IC = D().IC() + val dic: D.IC = D().IC() val di: D.NI? = null val kc: K.NC = K.NC() - val kic: K.IC = K().IC() + val kic: K.IC = K().IC() val ki: K.NI? = null } diff --git a/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.kt b/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.kt index a1990de8005..a961b7e7567 100644 --- a/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.kt +++ b/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.kt @@ -32,13 +32,13 @@ fun test() { val ii: I.NI? = null val bc: B.NC = B.NC() - val bic: B.IC = B().IC() + val bic: B.IC = B().IC() val bi: B.NI? = null val cc: C.NC = C.NC() val ci: C.NI? = null val dc: D.NC = D.NC() - val dic: D.IC = D().IC() + val dic: D.IC = D().IC() val di: D.NI? = null } diff --git a/compiler/testData/diagnostics/tests/inner/extensionFun.kt b/compiler/testData/diagnostics/tests/inner/extensionFun.kt index a63aa44dfd3..6515d9c486c 100644 --- a/compiler/testData/diagnostics/tests/inner/extensionFun.kt +++ b/compiler/testData/diagnostics/tests/inner/extensionFun.kt @@ -23,6 +23,6 @@ class Outer { fun Outer.foo() { Outer() - Nested() + Nested() Inner() } diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt index 35bd514a8ae..97024c2c7b1 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt @@ -24,30 +24,30 @@ object Obj { } fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) { - with.Nested() - with.NestedWithClassObject - with.NestedWithClassObject() - with.NestedWithClassObject.foo() + with.Nested() + with.NestedWithClassObject + with.NestedWithClassObject() + with.NestedWithClassObject.foo() with.NestedEnum.A with.NestedObj - with.NestedObj() + with.NestedObj() with.NestedObj.foo() - without.Nested() - without.NestedWithClassObject - without.NestedWithClassObject() - without.NestedWithClassObject.foo() + without.Nested() + without.NestedWithClassObject + without.NestedWithClassObject() + without.NestedWithClassObject.foo() without.NestedEnum.A without.NestedObj - without.NestedObj() + without.NestedObj() without.NestedObj.foo() - obj.Nested() - obj.NestedWithClassObject - obj.NestedWithClassObject() - obj.NestedWithClassObject.foo() + obj.Nested() + obj.NestedWithClassObject + obj.NestedWithClassObject() + obj.NestedWithClassObject.foo() obj.NestedEnum.A obj.NestedObj - obj.NestedObj() + obj.NestedObj() obj.NestedObj.foo() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt index 84752623c9e..63e7931aa9f 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt @@ -26,11 +26,11 @@ fun a() { consumeString(a plus b) consumeInt(a minus b) - a * b - a / b + a * b + a / b - a times b - a div b + a times b + a div b } } } diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt index 6b85e26f4da..3d0a15c26c5 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt @@ -24,7 +24,7 @@ operator fun Example.inc() = Example2() infix fun Example.plus(o: Example) = "" -fun a() { +fun test() { var a = Example() val b = Example() diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.txt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.txt index 42af19e26b5..bcf35d04680 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.txt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.txt @@ -1,9 +1,9 @@ package -public fun a(): kotlin.Unit public fun consumeExample2(/*0*/ e: Example2): kotlin.Unit public fun consumeInt(/*0*/ i: kotlin.Int): kotlin.Unit public fun consumeString(/*0*/ s: kotlin.String): kotlin.Unit +public fun test(): kotlin.Unit public operator fun Example.component1(): kotlin.String public operator fun Example.component2(): kotlin.String public operator fun Example.get(/*0*/ i: kotlin.Int): kotlin.String diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt index ca4e7ae7fc1..07d94ee0396 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt @@ -31,6 +31,6 @@ import p.* fun B.test() { if (this is C) { - "".getParent() + "".getParent() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.kt b/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.kt index 82334f62dcf..0cd1e4e50b4 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/intVsIntegerAmbiguity.kt @@ -24,10 +24,12 @@ class C fun foo(i: Int?) : C = null!! fun test(i: Int, ni: Int?) { - checkSubtype(foo(2)) - checkSubtype(foo(i)) + checkSubtype(foo(2)) + checkSubtype(J.foo(2)) + checkSubtype(J.foo(i)) + checkSubtype(J.foo(ni)) + checkSubtype(foo(ni)) checkSubtype(J.foo(ni)) - foo(ni) foo(J.getInteger()) J.foo(J.getInteger()) diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.kt index 93075ccb707..000797a550f 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/receiverPresenceErrorForInvoke.kt @@ -5,7 +5,7 @@ fun test1(f: String.() -> Unit) { } fun test2(f: (Int) -> Int) { - 1.f(2) + 1.f(2) - 2.(f)(2) + 2.(f)(2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt index 3eaa296e07f..2bb7af266a0 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt @@ -3,8 +3,8 @@ interface Foo { operator fun A.invoke() } -fun test(a: A, foo: Foo) { - a.foo() +fun test(a: A, foo: Foo) { + a.foo() } fun test(a: Int, foo: Int.()->Unit) { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt index 3d7acd8d43a..10899548247 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt @@ -12,7 +12,7 @@ fun test(a: A, b: B) { a.foo(b) with(a) { - b.foo() // todo + b.foo() b.(foo)() @@ -23,7 +23,7 @@ fun test(a: A, b: B) { } with(b) { - a.foo() + a.foo() a.(foo)() (a.foo)() @@ -68,7 +68,7 @@ fun test(a: A, b: B) { } with(b) { - a.foo() + a.foo() a.(foo)() (a.foo)() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt index 4f5fef9aef2..b60f5c2fe47 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt9805.kt @@ -6,7 +6,7 @@ class B fun test(a: A, b: B) { with(b) { - a.foo() // here must be error, because a is not extension receiver + a.foo() // here must be error, because a is not extension receiver a.foo(this) diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt index 5eca683f6fb..4cf52b42931 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/wrongInvokeExtension.kt @@ -9,11 +9,11 @@ val B.a: () -> Int get() = { 5 } fun test(a: A, b: B) { val x: Int = b.a() - b.(a)() + b.(a)() with(b) { val y: Int = a() - (a)() + (a)() } } diff --git a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt index 2b9ed42b787..e9597239b3a 100644 --- a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt +++ b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt @@ -1,5 +1,5 @@ // FILE: root.kt -fun testFun() = 12 +fun testFun() = "239" // FILE: otherPackage.kt package test @@ -9,4 +9,4 @@ fun testFun() = 12 // FILE: using.kt import test.* -val t = testFun() +val t: String = testFun() diff --git a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.txt b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.txt index d19f3081ce2..7842eac0688 100644 --- a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.txt +++ b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.txt @@ -1,7 +1,7 @@ package -public val t: [ERROR : Type for testFun()] -public fun testFun(): kotlin.Int +public val t: kotlin.String +public fun testFun(): kotlin.String package test { public fun testFun(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt b/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt index 36ce44491c8..afa0b31cac4 100644 --- a/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt +++ b/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt @@ -15,12 +15,12 @@ class A { inner class I { init { - T() // todo: fix error message + T() // todo: https://jetbrains.quip.com/hPM5AJcc1nca } } init { - T() + T() } } @@ -47,11 +47,11 @@ class B { inner class I { init { - T() + T() } } init { - T() + T() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.kt index 931029ea0a6..721d41ebe6b 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.kt @@ -33,8 +33,8 @@ class E: A() { object Z { init { - B().foo() // todo: some resolve hacks - B().bar() + B().foo() + B().bar() D() C() diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt index 820f5ca152d..be26864b233 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt @@ -31,6 +31,6 @@ public class X extends B { // FILE: 2.kt class Y: X() { init { - val a: Double = foo() // todo + val a: Double = foo() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt index eadb1fd1607..43955eaad66 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt @@ -13,5 +13,5 @@ class A { } constructor(x: Int) - constructor() : this(foo() + prop + B.bar() + B.prop + C) + constructor() : this(foo() + prop + B.bar() + B.prop + C) } diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt index 95905d6af36..75177c4da02 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt @@ -3,11 +3,15 @@ package foo fun f(l: List) {} +// FILE: bar.kt +package bar + +fun f(l: List) {} + // FILE: main.kt import foo.* - -fun f(l: List) {} +import bar.* fun test(l: List) { f(l) diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.txt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.txt index 0145608521d..53d6c5b63ec 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.txt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.txt @@ -1,8 +1,11 @@ package -public fun f(/*0*/ l: kotlin.List): kotlin.Unit public fun test(/*0*/ l: kotlin.List): kotlin.Unit +package bar { + public fun f(/*0*/ l: kotlin.List): kotlin.Unit +} + package foo { public fun f(/*0*/ l: kotlin.List): kotlin.Unit } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.kt index c7231e855f8..051becac757 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.kt @@ -47,7 +47,7 @@ fun test(d: dynamic) { val plus: dynamic = null } - C() + 5 + C() + 5 // todo should be marked as DEBUG_INFO_DYNAMIC C().plus(5) d == d diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt index 53ff9b7b1b4..b5b9a1399f2 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt @@ -27,7 +27,7 @@ fun dynamic.test() { this() C() + C() - +C() + +C() this + C() diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.kt index 8a1f41aac69..83498b46b76 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.kt @@ -8,15 +8,15 @@ fun T?.sure() : T = this!! fun List<*>.toArray(ar: Array): Array = ar fun testArrays(ci: List, cii: List?) { - val c1: Array = cii.sure().toArray(Array) + val c1: Array = cii.sure().toArray(Array) - val c2: Array = ci.toArray(Array()) + val c2: Array = ci.toArray(Array()) - val c3 = Array() + val c3 = Array() - val c4 = ci.toArray(Array()) + val c4 = ci.toArray(Array()) - val c5 = ci.toArray(Array()) + val c5 = ci.toArray(Array()) checkSubtype>(c1) checkSubtype>(c2) diff --git a/compiler/testData/resolve/ResolveOfInfixExpressions.resolve b/compiler/testData/resolve/ResolveOfInfixExpressions.resolve index 8ec9d7f2fdb..6b5f0e62ac1 100644 --- a/compiler/testData/resolve/ResolveOfInfixExpressions.resolve +++ b/compiler/testData/resolve/ResolveOfInfixExpressions.resolve @@ -76,8 +76,6 @@ fun tt(t : T) : T { `dec`--y y`dec`-- y `+=`+= 1 - `+`+y - `-`-y 1 `kotlin::Int.compareTo(Double)`> 2.0 1 `kotlin::Int.compareTo(Double)`< 2.0 1 `kotlin::Int.compareTo(Double)`>= 2.0 diff --git a/compiler/testData/resolve/candidatesPriority/closerReceiver1.resolve b/compiler/testData/resolve/candidatesPriority/closerReceiver1.resolve index bcb86152e0c..e283361c0a4 100644 --- a/compiler/testData/resolve/candidatesPriority/closerReceiver1.resolve +++ b/compiler/testData/resolve/candidatesPriority/closerReceiver1.resolve @@ -1,9 +1,9 @@ class A { - fun B.foo() = 2 + ~foo~fun B.foo() = 2 } class B { ~A.foo~fun A.foo() = 1 - fun A.bar() = `A.foo`foo() + fun A.bar() = `foo`foo() } diff --git a/compiler/testData/resolve/candidatesPriority/closerReceiver3.resolve b/compiler/testData/resolve/candidatesPriority/closerReceiver3.resolve index d82516cf5f7..532481e4b7a 100644 --- a/compiler/testData/resolve/candidatesPriority/closerReceiver3.resolve +++ b/compiler/testData/resolve/candidatesPriority/closerReceiver3.resolve @@ -1,7 +1,7 @@ class A class B { - fun foo() = 1 + ~foo~fun foo() = 1 ~A.foo~fun A.foo() = 2 - fun A.bar() = `A.foo`foo() + fun A.bar() = `foo`foo() } diff --git a/compiler/testData/resolve/candidatesPriority/dispatchReceiverVsExtensionReceiver2.resolve b/compiler/testData/resolve/candidatesPriority/dispatchReceiverVsExtensionReceiver2.resolve index 3d79b298f28..48dd07865d0 100644 --- a/compiler/testData/resolve/candidatesPriority/dispatchReceiverVsExtensionReceiver2.resolve +++ b/compiler/testData/resolve/candidatesPriority/dispatchReceiverVsExtensionReceiver2.resolve @@ -1,9 +1,9 @@ class A class B { - fun foo() = 2 + ~foo~fun foo() = 2 - fun A.bar() = `A.foo`foo() + fun A.bar() = `foo`foo() } ~A.foo~fun A.foo() = 1 diff --git a/compiler/testData/resolve/candidatesPriority/extensionToCloserReceiverVsMember.resolve b/compiler/testData/resolve/candidatesPriority/extensionToCloserReceiverVsMember.resolve index bb339f7a3bc..a49659bdbcd 100644 --- a/compiler/testData/resolve/candidatesPriority/extensionToCloserReceiverVsMember.resolve +++ b/compiler/testData/resolve/candidatesPriority/extensionToCloserReceiverVsMember.resolve @@ -1,5 +1,5 @@ class A { - fun foo() = 1 + ~A.foo~fun foo() = 1 } class B { } @@ -8,7 +8,7 @@ class B { fun test(a: A, b: B) { with (a) { with (b) { - `B.foo`foo() + `A.foo`foo() } } } diff --git a/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver.resolve b/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver.resolve index b23a3255a79..6dcaa611374 100644 --- a/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver.resolve +++ b/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver.resolve @@ -1,6 +1,6 @@ -fun ~A.foo~A.foo() = 1 -fun foo() = 2 +~A.foo~fun A.foo() = 1 +~foo~fun foo() = 2 class A { - fun test() = `A.foo`foo() + fun test() = `foo`foo() } \ No newline at end of file diff --git a/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver2.resolve b/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver2.resolve index 499b78dab00..446c819a041 100644 --- a/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver2.resolve +++ b/compiler/testData/resolve/candidatesPriority/implicitThisVsNoReceiver2.resolve @@ -1,11 +1,11 @@ class A { } ~extension~fun A.foo() = 1 -fun foo() = 2 +~simple~fun foo() = 2 fun test(a: A) { with (a) { - `extension`foo() + `simple`foo() } } diff --git a/compiler/testData/resolvedCalls/invoke/bothReceivers.kt b/compiler/testData/resolvedCalls/invoke/bothReceivers.kt index 589323adc33..b83fc42de3b 100644 --- a/compiler/testData/resolvedCalls/invoke/bothReceivers.kt +++ b/compiler/testData/resolvedCalls/invoke/bothReceivers.kt @@ -1,7 +1,3 @@ -class Foo() { - fun Int.invoke() {} -} - -fun bar(f: Foo) { +fun bar(f: Int.() -> Unit) { 1.f() } diff --git a/compiler/testData/resolvedCalls/invoke/bothReceivers.txt b/compiler/testData/resolvedCalls/invoke/bothReceivers.txt index 08ffec68176..e750ed8f60c 100644 --- a/compiler/testData/resolvedCalls/invoke/bothReceivers.txt +++ b/compiler/testData/resolvedCalls/invoke/bothReceivers.txt @@ -1,8 +1,4 @@ -class Foo() { - fun Int.invoke() {} -} - -fun bar(f: Foo) { +fun bar(f: Int.() -> Unit) { 1.f() } @@ -10,8 +6,8 @@ fun bar(f: Foo) { Resolved call: -Resulting descriptor: fun Int.invoke(): Unit defined in Foo +Resulting descriptor: operator fun Int.invoke(): Unit defined in kotlin.Function1 Explicit receiver kind = BOTH_RECEIVERS -Dispatch receiver = f {Foo} +Dispatch receiver = f {[@kotlin.Extension] Function1} Extension receiver = 1 {Int} diff --git a/idea/testData/checker/regression/createInnerInstance.kt b/idea/testData/checker/regression/createInnerInstance.kt index fc1249427a2..c891fbdf8ac 100644 --- a/idea/testData/checker/regression/createInnerInstance.kt +++ b/idea/testData/checker/regression/createInnerInstance.kt @@ -1,10 +1,11 @@ object A { - class B - fun foo() = 1 - object Bar{} + class B + fun foo() = 1 + object Bar {} } fun test(a: T) { - val c = (a as A) - c.B() -} \ No newline at end of file + val c = (a as A) + // TODO: report "nested class accessed via instance reference" + c.B() +} diff --git a/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.expected.kt b/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.expected.kt index 1c51f99f158..49dec27c578 100644 --- a/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.expected.kt +++ b/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.expected.kt @@ -1,6 +1,3 @@ -// ERROR: Overload resolution ambiguity: public fun a.A.ext(): kotlin.Unit defined in a public fun a.A.ext(): kotlin.Unit defined in to -// ERROR: Overload resolution ambiguity: public var a.A.p: kotlin.Int defined in a public var a.A.p: kotlin.Int defined in to -// ERROR: Overload resolution ambiguity: public var a.A.p: kotlin.Int defined in a public var a.A.p: kotlin.Int defined in to package to import a.A diff --git a/idea/testData/copyPaste/imports/ExtensionConflict.expected.kt b/idea/testData/copyPaste/imports/ExtensionConflict.expected.kt index 4f501695065..d8367d2dea9 100644 --- a/idea/testData/copyPaste/imports/ExtensionConflict.expected.kt +++ b/idea/testData/copyPaste/imports/ExtensionConflict.expected.kt @@ -1,8 +1,3 @@ -// ERROR: Overload resolution ambiguity: public fun a.A.ext(): kotlin.Unit defined in a public fun a.A.ext(): kotlin.Unit defined in to -// ERROR: Overload resolution ambiguity: public operator fun a.A.plus(a: a.A): kotlin.Unit defined in a public operator fun a.A.plus(a: a.A): kotlin.Unit defined in to -// ERROR: Overload resolution ambiguity: public infix fun a.A.infix(a: a.A): kotlin.Unit defined in a public infix fun a.A.infix(a: a.A): kotlin.Unit defined in to -// ERROR: Overload resolution ambiguity: public operator fun a.A.unaryMinus(): kotlin.Unit defined in a public operator fun a.A.unaryMinus(): kotlin.Unit defined in to -// ERROR: Overload resolution ambiguity: public val a.A.p: kotlin.Int defined in a public val a.A.p: kotlin.Int defined in to package to import a.A diff --git a/idea/testData/copyPaste/imports/ImportableEntityInExtensionLiteral.expected.kt b/idea/testData/copyPaste/imports/ImportableEntityInExtensionLiteral.expected.kt index ed44cf7e259..891e309e9d5 100644 --- a/idea/testData/copyPaste/imports/ImportableEntityInExtensionLiteral.expected.kt +++ b/idea/testData/copyPaste/imports/ImportableEntityInExtensionLiteral.expected.kt @@ -1,13 +1,13 @@ -// ERROR: Nested class 'Nested' should be qualified as 'A.Nested' package to +import a.A import a.ext import a.f fun g() { f { Inner() - Nested() + A.Nested() foo() ext() } diff --git a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference.kt b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference.kt index 762628431a9..a827a784897 100644 --- a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference.kt +++ b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference.kt @@ -1,4 +1,4 @@ -// !DIAGNOSTICS_NUMBER: 4 +// !DIAGNOSTICS_NUMBER: 3 // !DIAGNOSTICS: NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE class A { @@ -9,8 +9,8 @@ class A { } fun test(a: A) { - a.Nested() a.NestedWithClassObject a.NestedEnum a.NestedObj -} \ No newline at end of file + a.Nested() // TODO: report "nested class accessed via instance reference" here as well +} diff --git a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference1.txt b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference1.txt index 2b14c1a71f0..3607ee6ea14 100644 --- a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference1.txt +++ b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference1.txt @@ -1,2 +1,2 @@ -Nested class 'Nested' accessed via instance reference \ No newline at end of file +Nested class 'NestedWithClassObject' accessed via instance reference \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference2.txt b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference2.txt index 79d3bd4b225..48a69452d6d 100644 --- a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference2.txt +++ b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference2.txt @@ -1,2 +1,2 @@ -Nested companion object 'Companion' accessed via instance reference \ No newline at end of file +Nested enum class 'NestedEnum' accessed via instance reference \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference3.txt b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference3.txt index 08b3d9a6544..39677d7e78a 100644 --- a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference3.txt +++ b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference3.txt @@ -1,2 +1,2 @@ -Nested enum class 'NestedEnum' accessed via instance reference \ No newline at end of file +Nested object 'NestedObj' accessed via instance reference \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference4.txt b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference4.txt index a05479088ad..5c7807ba8ed 100644 --- a/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference4.txt +++ b/idea/testData/diagnosticMessage/nestedClassAcessedViaInstanceReference4.txt @@ -1,2 +1,2 @@ -Nested object 'NestedObj' accessed via instance reference \ No newline at end of file +Nested class 'Nested' accessed via instance reference \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/nestedClassShouldBeQualified.kt b/idea/testData/diagnosticMessage/nestedClassShouldBeQualified.kt index 4828fb7835a..92d416c184e 100644 --- a/idea/testData/diagnosticMessage/nestedClassShouldBeQualified.kt +++ b/idea/testData/diagnosticMessage/nestedClassShouldBeQualified.kt @@ -1,6 +1,8 @@ -// !DIAGNOSTICS_NUMBER: 5 +// !DIAGNOSTICS_NUMBER: 0 // !DIAGNOSTICS: NESTED_CLASS_SHOULD_BE_QUALIFIED +// TODO: 5 "nested class should be qualified" dianostics should be reported here + package p class A { diff --git a/idea/testData/findUsages/kotlin/conventions/plus.results.txt b/idea/testData/findUsages/kotlin/conventions/plus.results.txt index ced53573769..94d0ffc3b62 100644 --- a/idea/testData/findUsages/kotlin/conventions/plus.results.txt +++ b/idea/testData/findUsages/kotlin/conventions/plus.results.txt @@ -2,5 +2,4 @@ Function call (10: 17) A(0) + A(1) + 2 Function call (11: 20) A(0) plus A(1) plus 2 Function call (12: 20) A(0).plus(A(1).plus(2)) Function call (15: 7) a += 1 -Function call (6: 30) fun plus(a: A): A = this + a.n -Unclassified usage (18: 5) +A(0) +Function call (6: 30) fun plus(a: A): A = this + a.n \ No newline at end of file diff --git a/idea/testData/findUsages/propertyFiles/propertyUsages.1.kt b/idea/testData/findUsages/propertyFiles/propertyUsages.1.kt index 2ce13a13d24..de0e157c8be 100644 --- a/idea/testData/findUsages/propertyFiles/propertyUsages.1.kt +++ b/idea/testData/findUsages/propertyFiles/propertyUsages.1.kt @@ -6,7 +6,7 @@ public fun String.infixMessage(@PropertyKey(resourceBundle = "idea.testData.find public fun @receiver:PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String.infixMessage2(s: String) = this -public fun @receiver:PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String.minus() = this +public fun @receiver:PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") String.unaryMinus() = this public fun Int.get(@PropertyKey(resourceBundle = "idea.testData.findUsages.propertyFiles.propertyUsages.0") key: String) = this diff --git a/idea/testData/intentions/convertAssertToIf/assertErrorOverloaded.kt.after b/idea/testData/intentions/convertAssertToIf/assertErrorOverloaded.kt.after index 9350e639082..f4ee4d6537d 100644 --- a/idea/testData/intentions/convertAssertToIf/assertErrorOverloaded.kt.after +++ b/idea/testData/intentions/convertAssertToIf/assertErrorOverloaded.kt.after @@ -1,7 +1,5 @@ package a -import java.lang.AssertionError - fun foo() { if (!true) { throw AssertionError("text") diff --git a/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt b/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt index 882a1e6ef20..eaed5243312 100644 --- a/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt +++ b/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt @@ -1,6 +1,6 @@ -// PARAM_DESCRIPTOR: value-parameter val plus: kotlin.String.() -> kotlin.Unit defined in foo +// PARAM_DESCRIPTOR: value-parameter val unaryPlus: kotlin.String.() -> kotlin.Unit defined in foo // PARAM_TYPES: kotlin.String.() -> kotlin.Unit -fun foo(plus: String.() -> Unit) { +fun foo(unaryPlus: String.() -> Unit) { + "A" -} \ No newline at end of file +} diff --git a/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt.after b/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt.after index bcea3f951df..fa210685829 100644 --- a/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt.after +++ b/idea/testData/refactoring/extractFunction/basic/convertUnaryExpression.kt.after @@ -1,8 +1,8 @@ -// PARAM_DESCRIPTOR: value-parameter val plus: kotlin.String.() -> kotlin.Unit defined in foo +// PARAM_DESCRIPTOR: value-parameter val unaryPlus: kotlin.String.() -> kotlin.Unit defined in foo // PARAM_TYPES: kotlin.String.() -> kotlin.Unit -fun foo(plus: String.() -> Unit) { +fun foo(unaryPlus: String.() -> Unit) { "A".(function(plus))() } -private fun function(plus: String.() -> Unit) = plus \ No newline at end of file +private fun function(unaryPlus: String.() -> Unit) = unaryPlus diff --git a/idea/testData/resolve/references/CtrlClickResolve.kt b/idea/testData/resolve/references/CtrlClickResolve.kt index 4ab934eb009..9157fd9ed13 100644 --- a/idea/testData/resolve/references/CtrlClickResolve.kt +++ b/idea/testData/resolve/references/CtrlClickResolve.kt @@ -7,4 +7,4 @@ fun main(args : Array) { var a = IntArray(array(1, 2, 3)) } -// REF: (in kotlin.IntArray).IntArray(Int) \ No newline at end of file +// REF: (ctrl_click).IntArray(Int) diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java index 263c9d1a24a..2ae716194d4 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.java @@ -28,6 +28,7 @@ import com.intellij.refactoring.BaseRefactoringProcessor; import com.intellij.util.PathUtil; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.Convertor; +import junit.framework.ComparisonFailure; import kotlin.jvm.functions.Function0; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.idea.test.ConfigLibraryUtil; @@ -39,7 +40,6 @@ import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.test.InTextDirectivesUtils; import org.jetbrains.kotlin.test.KotlinTestUtils; import org.junit.Assert; -import org.junit.ComparisonFailure; import java.io.File; import java.util.ArrayList; @@ -178,7 +178,7 @@ public abstract class AbstractIntentionTest extends KotlinCodeInsightTestCase { checkResultByFile(canonicalPathToExpectedFile); } catch (ComparisonFailure e) { - KotlinTestUtils.assertEqualsToFile(new File(canonicalPathToExpectedFile), getEditor()); + KotlinTestUtils.assertEqualsToFile(new File(canonicalPathToExpectedFile), getEditor().getDocument().getText()); } } }