From 3f6cadf9b72d973d4e0266b3e60c70f10141aac1 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 24 Sep 2015 15:23:22 +0300 Subject: [PATCH] Change FUNCTION_EXPRESSION_WITH_NAME severity to ERROR Also drop deprecation related parts and get rid of usages of this `feature` within testData --- .../jetbrains/kotlin/diagnostics/Errors.java | 2 +- .../rendering/DefaultErrorMessages.java | 2 +- .../functionExpressionWithName.kt | 32 ------------- .../localReturnInsideFunctionExpression.kt | 7 --- .../functionExpression/extension.1.kt | 2 +- .../returnFromFunctionExpr.1.kt | 7 +-- .../nonLocalReturns/simpleFunctional.1.kt | 4 +- .../namedFunctionExpressionInProperty.kt | 16 ------- .../BlackBoxCodegenTestGenerated.java | 6 --- ...lackBoxWithStdlibCodegenTestGenerated.java | 6 --- .../inspections/KotlinCleanupInspection.kt | 1 - .../kotlin/idea/quickfix/QuickFixRegistrar.kt | 3 +- .../RemoveNameFromFunctionExpressionFix.kt | 23 ---------- .../lambdas/oneLineFunctionalExpression.kt | 2 +- idea/testData/inspections/cleanup/cleanup.kt | 2 - .../inspections/cleanup/cleanup.kt.after | 2 - .../manyFilesMuitliple.after.data.Sample.kt | 3 -- .../manyFilesMuitliple.after.kt | 46 ------------------- .../manyFilesMuitliple.before.Main.kt | 46 ------------------- .../manyFilesMuitliple.before.data.Sample.kt | 3 -- .../QuickFixMultiFileTestGenerated.java | 14 ------ .../FunctionExpressionTestGenerated.java | 6 --- 22 files changed, 8 insertions(+), 227 deletions(-) delete mode 100644 compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt delete mode 100644 compiler/testData/codegen/boxWithStdlib/reflection/enclosing/namedFunctionExpressionInProperty.kt delete mode 100644 idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.data.Sample.kt delete mode 100644 idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.kt delete mode 100644 idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.Main.kt delete mode 100644 idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.data.Sample.kt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index f976028d4ae..cb25a3c7ad9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -354,7 +354,7 @@ public interface Errors { DiagnosticFactory1.create(ERROR, DECLARATION_SIGNATURE); DiagnosticFactory0 FUNCTION_DECLARATION_WITH_NO_NAME = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE); - DiagnosticFactory0 FUNCTION_EXPRESSION_WITH_NAME = DiagnosticFactory0.create(WARNING); + DiagnosticFactory0 FUNCTION_EXPRESSION_WITH_NAME = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION = DiagnosticFactory0.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 34d01de87d6..3bbea8e2d08 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -221,7 +221,7 @@ public class DefaultErrorMessages { MAP.put(NON_MEMBER_FUNCTION_NO_BODY, "Function ''{0}'' must have a body", NAME); MAP.put(FUNCTION_DECLARATION_WITH_NO_NAME, "Function declaration must have a name"); - MAP.put(FUNCTION_EXPRESSION_WITH_NAME, "Function expressions with names are deprecated"); + MAP.put(FUNCTION_EXPRESSION_WITH_NAME, "Function expressions with names are prohibited"); MAP.put(NON_FINAL_MEMBER_IN_FINAL_CLASS, "\"open\" has no effect in a final class"); MAP.put(FUNCTION_EXPRESSION_PARAMETER_WITH_DEFAULT_VALUE, "A function expression is not allowed to specify default values for its parameters"); diff --git a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt deleted file mode 100644 index 8b58c18ff02..00000000000 --- a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt +++ /dev/null @@ -1,32 +0,0 @@ -val foo1 = fun Any.name(): String { -return "239" + this -} - -val foo2 = fun Int.name(i : Int) : Int = this + i - -fun fooT1() = fun name(t : T) = t.toString() - -annotation class A - -fun box() : String { - if(10.foo1() != "23910") return "foo1 fail" - if(10.foo2(1) != 11) return "foo2 fail" - - if(1.(fun Int.name() = this + 1)() != 2) return "test 3 failed"; - if( (fun name() = 1)() != 1) return "test 4 failed"; - if( (fun name(i: Int) = i)(1) != 1) return "test 5 failed"; - if( 1.(fun Int.name(i: Int) = i + this)(1) != 2) return "test 6 failed"; - if( (fooT1()("mama")) != "mama") return "test 7 failed"; - - val a = @A fun Int.name() = this + 1 // name - if (1.a() != 2) return "test 8 failed" - val b = ( fun Int.name() = this + 1) - if (1.b() != 2) return "test 9 failed" - val c = (c@ fun Int.name() = this + 1) - if (1.c() != 2) return "test 10 failed" - - val d = fun name(): Int { return@name 4} - if (d() != 4) return "test 11 failed" - - return "OK" -} diff --git a/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt b/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt index 2597c1a4189..5d3a5ad1a33 100644 --- a/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt +++ b/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt @@ -1,17 +1,10 @@ fun simple() = fun (): Boolean { return true } -fun simpleNamed() = fun name(): Boolean { return true } -fun simpleNamed2() = fun name(): Boolean { return@name true } - fun withLabel() = l@ fun (): Boolean { return@l true } -fun withLabelNamed() = l@ fun name(): Boolean { return@l true } fun box(): String { if (!simple()()) return "Test simple failed" - if (!simpleNamed()()) return "Test simpleNamed failed" - if (!simpleNamed2()()) return "Test simpleNamed2 failed" if (!withLabel()()) return "Test withLabel failed" - if (!withLabelNamed()()) return "Test withLabelNamed failed" return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/functionExpression/extension.1.kt b/compiler/testData/codegen/boxInline/functionExpression/extension.1.kt index e9961cb67e7..b039aa56257 100644 --- a/compiler/testData/codegen/boxInline/functionExpression/extension.1.kt +++ b/compiler/testData/codegen/boxInline/functionExpression/extension.1.kt @@ -1,6 +1,6 @@ fun test1(): Int { val inlineX = Inline(9) - return inlineX.calcExt(fun smth(z: Int) = z, 25) + return inlineX.calcExt(fun(z: Int) = z, 25) } fun test2(): Int { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt index e0b116c7ec5..585137d477c 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt @@ -9,15 +9,10 @@ fun test2(): String = (l@ fun (): String { return "fail" }) () -fun test3(): String = (l@ fun bar(): String { - foo { return@bar "OK" } - return "fail" -}) () - fun box(): String { if (test() != "OK") return "fail 1: ${test()}" if (test2() != "OK") return "fail 2: ${test2()}" - return test3() + return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/simpleFunctional.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/simpleFunctional.1.kt index e14077c7ab8..d970e21bcd2 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/simpleFunctional.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/simpleFunctional.1.kt @@ -21,7 +21,7 @@ fun test1(local: Int, nonLocal: String, doNonLocal: Boolean): String { fun test2(local: Int, nonLocal: String, doNonLocal: Boolean): String { val localResult = doCall( - fun xxx(): Int { + xxx@ fun(): Int { if (doNonLocal) { return@test2 nonLocal } @@ -39,7 +39,7 @@ fun test2(local: Int, nonLocal: String, doNonLocal: Boolean): String { fun test3(local: Int, nonLocal: String, doNonLocal: Boolean): String { val localResult = doCall( - yy@ fun xxx(): Int { + yy@ fun(): Int { if (doNonLocal) { return@test3 nonLocal } diff --git a/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/namedFunctionExpressionInProperty.kt b/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/namedFunctionExpressionInProperty.kt deleted file mode 100644 index 4f814390888..00000000000 --- a/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/namedFunctionExpressionInProperty.kt +++ /dev/null @@ -1,16 +0,0 @@ -val property = fun name() {} - -fun box(): String { - val javaClass = property.javaClass - - val enclosingMethod = javaClass.getEnclosingMethod() - if (enclosingMethod != null) return "method: $enclosingMethod" - - val enclosingClass = javaClass.getEnclosingClass()!!.getName() - if (enclosingClass != "NamedFunctionExpressionInPropertyKt") return "enclosing class: $enclosingClass" - - val declaringClass = javaClass.getDeclaringClass() - if (declaringClass != null) return "anonymous function has a declaring class: $declaringClass" - - return "OK" -} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java index 6f08b16af91..a856f29ed4f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -4164,12 +4164,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } - @TestMetadata("functionExpressionWithName.kt") - public void testFunctionExpressionWithName() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt"); - doTest(fileName); - } - @TestMetadata("functionExpressionWithThisReference.kt") public void testFunctionExpressionWithThisReference() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java index 92da717e6be..a07dfabae10 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java @@ -3384,12 +3384,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } - @TestMetadata("namedFunctionExpressionInProperty.kt") - public void testNamedFunctionExpressionInProperty() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/enclosing/namedFunctionExpressionInProperty.kt"); - doTestWithStdlib(fileName); - } - @TestMetadata("objectInLambda.kt") public void testObjectInLambda() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/enclosing/objectInLambda.kt"); diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt index 5d2e8867a2c..f2ffc8adaeb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt @@ -83,7 +83,6 @@ public class KotlinCleanupInspection(): LocalInspectionTool(), CleanupLocalInspe private val cleanupDiagnosticsFactories = setOf( Errors.MISSING_CONSTRUCTOR_KEYWORD, - Errors.FUNCTION_EXPRESSION_WITH_NAME, Errors.UNNECESSARY_NOT_NULL_ASSERTION, Errors.UNNECESSARY_SAFE_CALL, Errors.USELESS_CAST, diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt index 86b25b1c9e5..2c00d0a19d7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt @@ -303,8 +303,7 @@ public class QuickFixRegistrar : QuickFixContributor { MISSING_CONSTRUCTOR_KEYWORD.registerFactory(MissingConstructorKeywordFix, MissingConstructorKeywordFix.createWholeProjectFixFactory()) - FUNCTION_EXPRESSION_WITH_NAME.registerFactory(RemoveNameFromFunctionExpressionFix, - RemoveNameFromFunctionExpressionFix.createWholeProjectFixFactory()) + FUNCTION_EXPRESSION_WITH_NAME.registerFactory(RemoveNameFromFunctionExpressionFix) UNRESOLVED_REFERENCE.registerFactory(ReplaceObsoleteLabelSyntaxFix, ReplaceObsoleteLabelSyntaxFix.createWholeProjectFixFactory()) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveNameFromFunctionExpressionFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveNameFromFunctionExpressionFix.kt index fbffa2ac9bb..30959112346 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveNameFromFunctionExpressionFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveNameFromFunctionExpressionFix.kt @@ -16,18 +16,13 @@ package org.jetbrains.kotlin.idea.quickfix -import com.intellij.codeInsight.intention.IntentionAction import com.intellij.openapi.editor.Editor import com.intellij.openapi.project.Project -import com.intellij.psi.PsiWhiteSpace -import org.jetbrains.kotlin.JetNodeTypes import org.jetbrains.kotlin.diagnostics.Diagnostic import org.jetbrains.kotlin.idea.caches.resolve.analyze -import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionFactory import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionForFirstParentOfType import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.forEachDescendantOfType -import org.jetbrains.kotlin.psi.psiUtil.getNextSiblingIgnoringWhitespaceAndComments import org.jetbrains.kotlin.resolve.BindingContext public class RemoveNameFromFunctionExpressionFix(element: JetNamedFunction) : JetIntentionAction(element), CleanupFix { @@ -41,24 +36,6 @@ public class RemoveNameFromFunctionExpressionFix(element: JetNamedFunction) : Je override fun createAction(diagnostic: Diagnostic) = diagnostic.createIntentionForFirstParentOfType(::RemoveNameFromFunctionExpressionFix) - public fun createWholeProjectFixFactory(): JetSingleIntentionActionFactory = createIntentionFactory { - JetWholeProjectForEachElementOfTypeFix.createByPredicate( - predicate = { isFunctionExpression(it) }, - taskProcessor = { removeNameFromFunction(it) }, - name = "Remove identifier from function expressions in the whole project" - ) - } - - private fun isFunctionExpression(function: JetNamedFunction): Boolean { - var parent = function.getParent() - - while (parent is JetAnnotatedExpression || parent is JetLabeledExpression) { - parent = parent.getParent() - } - - return function.isLocal() && parent !is JetBlockExpression - } - private fun removeNameFromFunction(function: JetNamedFunction) { var wereAutoLabelUsages = false val name = function.getNameAsName() ?: return diff --git a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/oneLineFunctionalExpression.kt b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/oneLineFunctionalExpression.kt index a80630a3721..12a87d9bbcd 100644 --- a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/oneLineFunctionalExpression.kt +++ b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/oneLineFunctionalExpression.kt @@ -6,7 +6,7 @@ fun main(args: Array) { // RESULT: 1: I // STEP_INTO: 2 //Breakpoint! - a.foo (fun b(it): A { return a }) + a.foo (fun(it): A { return a }) } class A { diff --git a/idea/testData/inspections/cleanup/cleanup.kt b/idea/testData/inspections/cleanup/cleanup.kt index 77da842b84b..0edf7836b6c 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt +++ b/idea/testData/inspections/cleanup/cleanup.kt @@ -4,8 +4,6 @@ import pack.oldFun3 class A private() -val x = fun foo(x: String) { } - fun foo() { @loop for (i in 1..100) { diff --git a/idea/testData/inspections/cleanup/cleanup.kt.after b/idea/testData/inspections/cleanup/cleanup.kt.after index 0e5a85b5847..7d19e715209 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt.after +++ b/idea/testData/inspections/cleanup/cleanup.kt.after @@ -3,8 +3,6 @@ import pack.oldFun2 // should not be removed for non-deprecated overload used class A private constructor() -val x = fun(x: String) { } - fun foo() { loop@ for (i in 1..100) { diff --git a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.data.Sample.kt b/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.data.Sample.kt deleted file mode 100644 index 317eb0defd2..00000000000 --- a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.data.Sample.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - (fun() {}) -} diff --git a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.kt b/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.kt deleted file mode 100644 index acf8277eaa4..00000000000 --- a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.after.kt +++ /dev/null @@ -1,46 +0,0 @@ -// "Remove identifier from function expressions in the whole project" "true" - -inline fun run(block: () -> Unit) = block() -annotation class ann - -fun foo() { - l2@ @ann l2@ fun local() { - run(l1@ fun() { return@l1 }) - - run(label@ expr@ fun() { - return@label - return@expr - }) - } -} - -class A { - fun bar() { - run(toRun@ fun() { - if (1 == 1) return@toRun - return@bar - }) - - run( - /* abc */ fun /* cde */ () { - return@bar - } - ) - - run( - /* abc */ - foo@ fun /* cde */ () { - return@foo - } - ) - } - - init { - (foo@ fun A.() { - (fun() { - val x = 1 - }) - return@foo - }) - } -} diff --git a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.Main.kt b/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.Main.kt deleted file mode 100644 index f8d30ca77d1..00000000000 --- a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.Main.kt +++ /dev/null @@ -1,46 +0,0 @@ -// "Remove identifier from function expressions in the whole project" "true" - -inline fun run(block: () -> Unit) = block() -annotation class ann - -fun foo() { - l2@ @ann l2@ fun local() { - run(l1@ fun() { return@l1 }) - - run(label@ fun expr() { - return@label - return@expr - }) - } -} - -class A { - fun bar() { - run(fun toRun() { - if (1 == 1) return@toRun - return@bar - }) - - run( - /* abc */ fun /* cde */ toRun() { - return@bar - } - ) - - run( - /* abc */ - fun /* cde */ foo() { - return@foo - } - ) - } - - init { - (fun A.foo() { - (fun bar() { - val x = 1 - }) - return@foo - }) - } -} diff --git a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.data.Sample.kt b/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.data.Sample.kt deleted file mode 100644 index 9917038de9d..00000000000 --- a/idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.data.Sample.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - (fun foo() {}) -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java index db14b12c0e9..8928a05c193 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java @@ -1129,20 +1129,6 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes } } - @TestMetadata("idea/testData/quickfix/migration/removeNameFromFunctionExpression") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class RemoveNameFromFunctionExpression extends AbstractQuickFixMultiFileTest { - public void testAllFilesPresentInRemoveNameFromFunctionExpression() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/removeNameFromFunctionExpression"), Pattern.compile("^(\\w+)\\.before\\.Main\\.kt$"), true); - } - - @TestMetadata("manyFilesMuitliple.before.Main.kt") - public void testManyFilesMuitliple() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/removeNameFromFunctionExpression/manyFilesMuitliple.before.Main.kt"); - doTestWithExtraFile(fileName); - } - } } @TestMetadata("idea/testData/quickfix/modifiers") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/FunctionExpressionTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/FunctionExpressionTestGenerated.java index 1451c938991..e60ee537fba 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/FunctionExpressionTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/FunctionExpressionTestGenerated.java @@ -41,12 +41,6 @@ public class FunctionExpressionTestGenerated extends AbstractFunctionExpressionT doTest(fileName); } - @TestMetadata("functionExpressionWithName.kt") - public void testFunctionExpressionWithName() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt"); - doTest(fileName); - } - @TestMetadata("functionExpressionWithThisReference.kt") public void testFunctionExpressionWithThisReference() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt");