From e8fcd194f9c2b10f811327a55c1275de0549a3c0 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 26 Aug 2016 12:02:04 +0200 Subject: [PATCH] add test for obsolete KT-11601 --- idea/testData/codeInsight/expressionType/Kt11601.kt | 9 +++++++++ .../idea/codeInsight/AbstractExpressionTypeTest.kt | 1 + .../idea/codeInsight/ExpressionTypeTestGenerated.java | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100644 idea/testData/codeInsight/expressionType/Kt11601.kt diff --git a/idea/testData/codeInsight/expressionType/Kt11601.kt b/idea/testData/codeInsight/expressionType/Kt11601.kt new file mode 100644 index 00000000000..1d10741e651 --- /dev/null +++ b/idea/testData/codeInsight/expressionType/Kt11601.kt @@ -0,0 +1,9 @@ +fun x(){ + val challenges = mutableListOf<() -> Unit>() + for (c in challenges) { + c() + } +} + +// TYPE: c -> () → Unit +// TYPE: c() -> Unit diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractExpressionTypeTest.kt b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractExpressionTypeTest.kt index 8779779de1c..cb44d87a9cb 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractExpressionTypeTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractExpressionTypeTest.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.idea.codeInsight import com.intellij.testFramework.UsefulTestCase import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase +import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor import org.jetbrains.kotlin.idea.test.PluginTestCaseBase import org.jetbrains.kotlin.test.InTextDirectivesUtils diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/ExpressionTypeTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/ExpressionTypeTestGenerated.java index 6ad5cf8e966..21c5e6a12f6 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/ExpressionTypeTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/ExpressionTypeTestGenerated.java @@ -47,6 +47,12 @@ public class ExpressionTypeTestGenerated extends AbstractExpressionTypeTest { doTest(fileName); } + @TestMetadata("Kt11601.kt") + public void testKt11601() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/expressionType/Kt11601.kt"); + doTest(fileName); + } + @TestMetadata("MultiDeclaration.kt") public void testMultiDeclaration() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/expressionType/MultiDeclaration.kt");