From cf04ba49437dfb7a7f2033f3520d39d089a190bb Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 8 Oct 2014 20:01:47 +0400 Subject: [PATCH] Corrected test data --- .../accidentalOverrides/phantomClashWithSamAdapter.kt | 6 +++--- idea/testData/checker/Abstract.kt | 10 ++++++++++ idea/testData/checker/ClassObjects.kt | 3 ++- idea/testData/formatter/SpacesInDeclarations.after.kt | 3 +++ .../simpleInitWithComments.kt.after | 2 +- .../simpleInitWithComments2.kt.after | 2 +- .../createFunction/set/afterCreateSetFromUsage2.kt | 1 + .../createFunction/set/beforeCreateSetFromUsage2.kt | 1 + .../afterWrongGetterParameterTypeLongNameRuntime.kt | 1 + .../beforeWrongGetterParameterTypeLongNameRuntime.kt | 1 + ...iteralParameterTypeToFunctionTypeLongNameRuntime.kt | 1 + ...turnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt | 1 + ...fterExpectedParameterTypeMismatchLongNameRuntime.kt | 1 + .../afterPropertyTypeMismatchLongNameRuntime.kt | 1 + ...iteralParameterTypeToFunctionTypeLongNameRuntime.kt | 1 + ...turnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt | 1 + ...foreExpectedParameterTypeMismatchLongNameRuntime.kt | 1 + .../beforePropertyTypeMismatchLongNameRuntime.kt | 1 + 18 files changed, 32 insertions(+), 6 deletions(-) diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/phantomClashWithSamAdapter.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/phantomClashWithSamAdapter.kt index b47b41b1d6c..3efdcca174e 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/phantomClashWithSamAdapter.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/phantomClashWithSamAdapter.kt @@ -23,6 +23,6 @@ import p.* open class K0 : Foo() class K : K0() { - // We keep this test to make sure ACCIDENTAL_OVERRIDE is not reported - fun foo(f: () -> Unit) {} -} + // We keep this test to make sure ACCIDENTAL_OVERRIDE is not reported + fun foo(f: () -> Unit) {} +} \ No newline at end of file diff --git a/idea/testData/checker/Abstract.kt b/idea/testData/checker/Abstract.kt index 0aaf80c7328..637ac6fa125 100644 --- a/idea/testData/checker/Abstract.kt +++ b/idea/testData/checker/Abstract.kt @@ -2,6 +2,7 @@ package abstract class MyClass() { //properties + val a: Int val a1: Int = 1 abstract val a2: Int @@ -23,6 +24,7 @@ class MyClass() { abstract val e3: Int = 0; get() = a //methods + fun f() fun g() {} abstract fun h() @@ -31,6 +33,7 @@ class MyClass() { abstract class MyAbstractClass() { //properties + val a: Int val a1: Int = 1 abstract val a2: Int @@ -52,6 +55,7 @@ abstract class MyAbstractClass() { abstract val e3: Int = 0; get() = a //methods + fun f() fun g() {} abstract fun h() @@ -60,6 +64,7 @@ abstract class MyAbstractClass() { trait MyTrait { //properties + val a: Int val a1: Int = 1 abstract val a2: Int @@ -81,6 +86,7 @@ trait MyTrait { abstract val e3: Int = 0; get() = a //methods + fun f() fun g() {} abstract fun h() @@ -89,6 +95,7 @@ trait MyTrait { enum class MyEnum() { //properties + val a: Int val a1: Int = 1 abstract val a2: Int @@ -110,6 +117,7 @@ enum class MyEnum() { abstract val e3: Int = 0; get() = a //methods + fun f() fun g() {} abstract fun h() @@ -119,6 +127,7 @@ enum class MyEnum() { abstract enum class MyAbstractEnum() {} //properties + val a: Int val a1: Int = 1 abstract val a2: Int @@ -140,6 +149,7 @@ val e1: Int = 0; get() = a abstract val e3: Int = 0; get() = a //methods + fun f() fun g() {} abstract fun h() diff --git a/idea/testData/checker/ClassObjects.kt b/idea/testData/checker/ClassObjects.kt index 7a36c4b4000..7020b25ff0f 100644 --- a/idea/testData/checker/ClassObjects.kt +++ b/idea/testData/checker/ClassObjects.kt @@ -16,7 +16,8 @@ class B() { object b { class object { val x = 1 - } // error + } + // error } val a = A.x diff --git a/idea/testData/formatter/SpacesInDeclarations.after.kt b/idea/testData/formatter/SpacesInDeclarations.after.kt index 22425aff0e2..2ea61610413 100644 --- a/idea/testData/formatter/SpacesInDeclarations.after.kt +++ b/idea/testData/formatter/SpacesInDeclarations.after.kt @@ -21,6 +21,7 @@ public fun Int.extFun1() { public fun Int.extFun2() { } + //----------------------- val fooVal1 = 1 @@ -41,8 +42,10 @@ public var Int.extVar1: Int = 122 public var Int.extVar: Int = 1 + //----------------------- annotation class A1 + annotation class A2 private [A1 A2 A1] A1 A2 [A1 A2 A2] [A1] val fooProp1 = 1 diff --git a/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments.kt.after b/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments.kt.after index cbb494ec529..0c18301cde6 100644 --- a/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments.kt.after +++ b/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments.kt.after @@ -1,5 +1,5 @@ fun foo(n: Int) { // foo3 - val /* foo */ x: String = "" // bar3 + val /* foo */ x: String = "" // foo2 // bar3 /* baz */ } \ No newline at end of file diff --git a/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments2.kt.after b/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments2.kt.after index cbb494ec529..0c18301cde6 100644 --- a/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments2.kt.after +++ b/idea/testData/joinLines/declarationAndAssignment/simpleInitWithComments2.kt.after @@ -1,5 +1,5 @@ fun foo(n: Int) { // foo3 - val /* foo */ x: String = "" // bar3 + val /* foo */ x: String = "" // foo2 // bar3 /* baz */ } \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createFunction/set/afterCreateSetFromUsage2.kt b/idea/testData/quickfix/createFromUsage/createFunction/set/afterCreateSetFromUsage2.kt index 842df9921fb..9d92d5b0eec 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/set/afterCreateSetFromUsage2.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/set/afterCreateSetFromUsage2.kt @@ -1,4 +1,5 @@ // "Create function 'set' from usage" "true" + import java.util.ArrayList class Foo { diff --git a/idea/testData/quickfix/createFromUsage/createFunction/set/beforeCreateSetFromUsage2.kt b/idea/testData/quickfix/createFromUsage/createFunction/set/beforeCreateSetFromUsage2.kt index dfdab89d714..a6e6f32841f 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/set/beforeCreateSetFromUsage2.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/set/beforeCreateSetFromUsage2.kt @@ -1,4 +1,5 @@ // "Create function 'set' from usage" "true" + class Foo { fun x (y: Any, w: java.util.ArrayList) { y["", w] = w diff --git a/idea/testData/quickfix/typeAddition/afterWrongGetterParameterTypeLongNameRuntime.kt b/idea/testData/quickfix/typeAddition/afterWrongGetterParameterTypeLongNameRuntime.kt index e58d100161c..0e608dc82a1 100644 --- a/idea/testData/quickfix/typeAddition/afterWrongGetterParameterTypeLongNameRuntime.kt +++ b/idea/testData/quickfix/typeAddition/afterWrongGetterParameterTypeLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change getter type to Module" "true" + import kotlin.modules.Module class A() { diff --git a/idea/testData/quickfix/typeAddition/beforeWrongGetterParameterTypeLongNameRuntime.kt b/idea/testData/quickfix/typeAddition/beforeWrongGetterParameterTypeLongNameRuntime.kt index 50e67a5002e..a0d95d92625 100644 --- a/idea/testData/quickfix/typeAddition/beforeWrongGetterParameterTypeLongNameRuntime.kt +++ b/idea/testData/quickfix/typeAddition/beforeWrongGetterParameterTypeLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change getter type to Module" "true" + class A() { val i: kotlin.modules.Module get(): Any = kotlin.modules.ModuleBuilder("", "") diff --git a/idea/testData/quickfix/typeMismatch/afterChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/afterChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt index 224187bae36..048d845f81b 100644 --- a/idea/testData/quickfix/typeMismatch/afterChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/afterChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change type from 'String' to '(ModuleBuilder) -> Module'" "true" + import kotlin.modules.ModuleBuilder import kotlin.modules.Module diff --git a/idea/testData/quickfix/typeMismatch/afterChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/afterChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt index 009a73f39c0..22c50fd86c2 100644 --- a/idea/testData/quickfix/typeMismatch/afterChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/afterChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change 'bar' function return type to 'Module'" "true" + import kotlin.modules.Module fun bar(): Module = kotlin.modules.ModuleBuilder("", "") diff --git a/idea/testData/quickfix/typeMismatch/afterExpectedParameterTypeMismatchLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/afterExpectedParameterTypeMismatchLongNameRuntime.kt index e4f6d9a9353..fdf5b6ba4e9 100644 --- a/idea/testData/quickfix/typeMismatch/afterExpectedParameterTypeMismatchLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/afterExpectedParameterTypeMismatchLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change type from 'String' to 'Module'" "true" + import kotlin.modules.Module fun foo(f: (Module) -> String) { diff --git a/idea/testData/quickfix/typeMismatch/afterPropertyTypeMismatchLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/afterPropertyTypeMismatchLongNameRuntime.kt index fed156ff102..57b9c2711e4 100644 --- a/idea/testData/quickfix/typeMismatch/afterPropertyTypeMismatchLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/afterPropertyTypeMismatchLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change 'f' type to '(Delegates) -> Unit'" "true" + import kotlin.properties.Delegates fun foo() { diff --git a/idea/testData/quickfix/typeMismatch/beforeChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/beforeChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt index 887fc28f25a..e8cc4332aa3 100644 --- a/idea/testData/quickfix/typeMismatch/beforeChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/beforeChangeFunctionLiteralParameterTypeToFunctionTypeLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change type from 'String' to '(ModuleBuilder) -> Module'" "true" + fun foo(f: ((kotlin.modules.ModuleBuilder) -> kotlin.modules.Module) -> String) { foo { (f: String) -> "42" diff --git a/idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt index a279b90f603..03883440b26 100644 --- a/idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToMatchExpectedTypeOfCallLongNameRuntime.kt @@ -1,3 +1,4 @@ // "Change 'bar' function return type to 'Module'" "true" + fun bar(): Any = kotlin.modules.ModuleBuilder("", "") fun foo(): kotlin.modules.Module = bar() \ No newline at end of file diff --git a/idea/testData/quickfix/typeMismatch/beforeExpectedParameterTypeMismatchLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/beforeExpectedParameterTypeMismatchLongNameRuntime.kt index 113e80c9b27..b401cf85aab 100644 --- a/idea/testData/quickfix/typeMismatch/beforeExpectedParameterTypeMismatchLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/beforeExpectedParameterTypeMismatchLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change type from 'String' to 'Module'" "true" + fun foo(f: (kotlin.modules.Module) -> String) { foo { (x: String) -> "" diff --git a/idea/testData/quickfix/typeMismatch/beforePropertyTypeMismatchLongNameRuntime.kt b/idea/testData/quickfix/typeMismatch/beforePropertyTypeMismatchLongNameRuntime.kt index f4be04ad5a6..cc3c789f2fb 100644 --- a/idea/testData/quickfix/typeMismatch/beforePropertyTypeMismatchLongNameRuntime.kt +++ b/idea/testData/quickfix/typeMismatch/beforePropertyTypeMismatchLongNameRuntime.kt @@ -1,4 +1,5 @@ // "Change 'f' type to '(Delegates) -> Unit'" "true" + fun foo() { var f: Int = { (x: kotlin.properties.Delegates) -> } } \ No newline at end of file