diff --git a/idea/testData/checker/BoundsWithSubstitutors.kt b/idea/testData/checker/BoundsWithSubstitutors.kt index 4d346933c7e..c5432e9a246 100644 --- a/idea/testData/checker/BoundsWithSubstitutors.kt +++ b/idea/testData/checker/BoundsWithSubstitutors.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + open class A class B>() diff --git a/idea/testData/checker/FunctionReturnTypes.kt b/idea/testData/checker/FunctionReturnTypes.kt index 9be498b02b5..0bfa1cd65ee 100644 --- a/idea/testData/checker/FunctionReturnTypes.kt +++ b/idea/testData/checker/FunctionReturnTypes.kt @@ -1,4 +1,6 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference // RUNTIME + fun none() {} fun unitEmptyInfer() {} diff --git a/idea/testData/checker/QualifiedExpressions.kt b/idea/testData/checker/QualifiedExpressions.kt index 7307c624b9e..a770531c37c 100644 --- a/idea/testData/checker/QualifiedExpressions.kt +++ b/idea/testData/checker/QualifiedExpressions.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + package qualified_expressions fun test(s: IntRange?) { diff --git a/idea/testData/checker/SafeInvoke.kt b/idea/testData/checker/SafeInvoke.kt index db9c7b6a7c3..e1e13057658 100644 --- a/idea/testData/checker/SafeInvoke.kt +++ b/idea/testData/checker/SafeInvoke.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + class Rule(val apply: () -> Unit) fun foo() { diff --git a/idea/testData/checker/diagnosticsMessage/noSubstitutedTypeParameter.kt b/idea/testData/checker/diagnosticsMessage/noSubstitutedTypeParameter.kt index 25c1ac49f66..7703e1ab3f2 100644 --- a/idea/testData/checker/diagnosticsMessage/noSubstitutedTypeParameter.kt +++ b/idea/testData/checker/diagnosticsMessage/noSubstitutedTypeParameter.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + val f = listOf("").s) { diff --git a/idea/testData/checker/infos/SmartCasts.kt b/idea/testData/checker/infos/SmartCasts.kt index 51cfc85dbd1..3a7140b781c 100644 --- a/idea/testData/checker/infos/SmartCasts.kt +++ b/idea/testData/checker/infos/SmartCasts.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + open class A() { fun foo() { if (this is B) { diff --git a/idea/testData/checker/infos/smartCastOnElvis.kt b/idea/testData/checker/infos/smartCastOnElvis.kt index 5be2b9e2729..32c812f1d32 100644 --- a/idea/testData/checker/infos/smartCastOnElvis.kt +++ b/idea/testData/checker/infos/smartCastOnElvis.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo(s: String) = s.length fun baz(s: String?, r: String?): Int { diff --git a/idea/testData/checker/rendering/TypeInferenceError.kt b/idea/testData/checker/rendering/TypeInferenceError.kt index d82b2759194..4d3c15fb2b1 100644 --- a/idea/testData/checker/rendering/TypeInferenceError.kt +++ b/idea/testData/checker/rendering/TypeInferenceError.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun testMutableMapEntry(map: MutableMap, k1: K, v: V) { } diff --git a/idea/testData/codeInsight/lineMarker/recursiveCall/companionInvoke.kt b/idea/testData/codeInsight/lineMarker/recursiveCall/companionInvoke.kt index eced2f29f8a..bf8e2c52674 100644 --- a/idea/testData/codeInsight/lineMarker/recursiveCall/companionInvoke.kt +++ b/idea/testData/codeInsight/lineMarker/recursiveCall/companionInvoke.kt @@ -1,5 +1,5 @@ class Example(val dummy: Any?) { companion object { - operator fun invoke() = Example() + operator fun invoke(): Example = Example() } } \ No newline at end of file diff --git a/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt b/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt index 47f2d71c00e..43b2fdfce78 100644 --- a/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt +++ b/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt @@ -1,4 +1,5 @@ // RUNTIME_WITH_FULL_JDK +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference val s = Sam { d, t -> val s = "$d$t" listOf(s) diff --git a/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt.after b/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt.after index cb6056af24a..6f90881a9dd 100644 --- a/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt.after +++ b/idea/testData/intentions/samConversionToAnonymousObject/simple3.kt.after @@ -2,6 +2,7 @@ import java.time.LocalDate import java.time.LocalDateTime // RUNTIME_WITH_FULL_JDK +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference val s = object : Sam { override fun test(d: LocalDate, t: LocalDateTime): List { val s = "$d$t" diff --git a/idea/testData/parameterInfo/arrayAccess/SetTooManyArgs.kt b/idea/testData/parameterInfo/arrayAccess/SetTooManyArgs.kt index 25391281b9a..472f06274fe 100644 --- a/idea/testData/parameterInfo/arrayAccess/SetTooManyArgs.kt +++ b/idea/testData/parameterInfo/arrayAccess/SetTooManyArgs.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + class A { operator fun get(x: Int) {} operator fun set(x: String, value: Int) {} diff --git a/idea/testData/parameterInfo/functionCall/FunctionalValueGeneric1.kt b/idea/testData/parameterInfo/functionCall/FunctionalValueGeneric1.kt index 1c3dad2e631..df4ce0a76b0 100644 --- a/idea/testData/parameterInfo/functionCall/FunctionalValueGeneric1.kt +++ b/idea/testData/parameterInfo/functionCall/FunctionalValueGeneric1.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun T.foo(): (item: T) -> Unit{} fun f() { diff --git a/idea/testData/parameterInfo/withLib2/useJavaSAMFromLib.kt b/idea/testData/parameterInfo/withLib2/useJavaSAMFromLib.kt index 7480e92b3d6..5a48c32cddd 100644 --- a/idea/testData/parameterInfo/withLib2/useJavaSAMFromLib.kt +++ b/idea/testData/parameterInfo/withLib2/useJavaSAMFromLib.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + package test diff --git a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt index c9d27fd17cd..da44ba69398 100644 --- a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt +++ b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo(p1: String, p2: () -> Boolean) = bar(p1, null, p2) fun bar(p1: String, p2: String?, p3: () -> Boolean) diff --git a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after index ca809dec7f3..05adffbe97a 100644 --- a/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after +++ b/idea/testData/refactoring/inline/function/expressionBody/FunctionalParameterPassed.kt.after @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun bar(p1: String, p2: String?, p3: () -> Boolean) fun foo(i: I) { diff --git a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt index 04d899c3945..e5eb02f8033 100644 --- a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt +++ b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + import java.util.ArrayList fun f() { diff --git a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt.after b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt.after index 99f358a8160..bc63b91db39 100644 --- a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt.after +++ b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall.kt.after @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + import java.util.ArrayList fun f() { diff --git a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt index 6275df9394c..b4af9fee862 100644 --- a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt +++ b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo(f: List) {} fun f() { diff --git a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt.after b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt.after index 72af716aa1c..fcdacc128e3 100644 --- a/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt.after +++ b/idea/testData/refactoring/inline/inlineVariableOrProperty/explicateTypeArgument/DeeperNestedCall2.kt.after @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo(f: List) {} fun f() { diff --git a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/AbstractParameterInfoTest.kt b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/AbstractParameterInfoTest.kt index 5f4574e82e6..265d8c91bda 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/AbstractParameterInfoTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/AbstractParameterInfoTest.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.idea.KotlinLanguage import org.jetbrains.kotlin.idea.test.SdkAndMockLibraryProjectDescriptor import org.jetbrains.kotlin.idea.test.PluginTestCaseBase import org.jetbrains.kotlin.idea.test.ProjectDescriptorWithStdlibSources +import org.jetbrains.kotlin.idea.test.configureCompilerOptions import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.psiUtil.allChildren @@ -51,6 +52,9 @@ abstract class AbstractParameterInfoTest : LightCodeInsightFixtureTestCase() { myFixture.configureByFile(fileName) val file = myFixture.file as KtFile + + configureCompilerOptions(file.text, project, myFixture.module) + val lastChild = file.allChildren.filter { it !is PsiWhiteSpace }.last() val expectedResultText = when (lastChild.node.elementType) { KtTokens.BLOCK_COMMENT -> lastChild.text.substring(2, lastChild.text.length - 2).trim() diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt index a1fcb584d47..ad9de1fded3 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt @@ -18,6 +18,7 @@ import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture import junit.framework.TestCase import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor +import org.jetbrains.kotlin.idea.test.configureCompilerOptions import org.jetbrains.kotlin.idea.util.application.runWriteAction import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.test.KotlinTestUtils @@ -39,6 +40,8 @@ abstract class AbstractInlineTest : KotlinLightCodeInsightFixtureTestCase() { val extraFilesToPsi = extraFiles.associateBy { fixture.configureByFile(path.replace(mainFileName, it.name)) } val file = myFixture.configureByFile(path) + configureCompilerOptions(file.text, project, module) + val afterFileExists = afterFile.exists() val targetElement = TargetElementUtil.findTargetElement(myFixture.editor, ELEMENT_NAME_ACCEPTED or REFERENCED_ELEMENT_ACCEPTED)!!