diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCast.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCast.kt index cf9d9cd82c5..dd79c7320db 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCast.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCast.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun String.forString(){} fun Any.forAny(){} diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCastWithWrongReturnType.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCastWithWrongReturnType.kt index a54ea50b419..2ff38e3d707 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCastWithWrongReturnType.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/NonPredictableSmartCastWithWrongReturnType.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + interface A { fun foo(): Any fun bar() diff --git a/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt b/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt index 0157a3d39ec..9c20c32c14c 100644 --- a/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt +++ b/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + val v: Boolean = run { return true } diff --git a/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt.after b/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt.after index 04307fffee8..7511b864e13 100644 --- a/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt.after +++ b/idea/idea-completion/testData/handlers/basic/AddLabelToReturn.kt.after @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + val v: Boolean = run { return@run true } diff --git a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt index 4fb22014b1e..dbada384d1e 100644 --- a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt +++ b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo() { takeHandler1 { takeHandler2({ ret }) diff --git a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt.after b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt.after index 5804d5f9252..7d22fefac82 100644 --- a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt.after +++ b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnit.kt.after @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo() { takeHandler1 { takeHandler2({ return@takeHandler2 }) diff --git a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt index 05ceab7ebdf..80599569027 100644 --- a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt +++ b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo() { takeHandler1 { takeHandler2({ -> ret }) diff --git a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt.after b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt.after index dd217a15d0e..683258c5639 100644 --- a/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt.after +++ b/idea/idea-completion/testData/handlers/keywords/QualifiedReturnNonUnitExplicit.kt.after @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo() { takeHandler1 { takeHandler2({ -> return@takeHandler2 }) diff --git a/idea/idea-completion/testData/smart/lambdaSignature/MultipleParameters.kt b/idea/idea-completion/testData/smart/lambdaSignature/MultipleParameters.kt index 6b5224340f5..2a60059a521 100644 --- a/idea/idea-completion/testData/smart/lambdaSignature/MultipleParameters.kt +++ b/idea/idea-completion/testData/smart/lambdaSignature/MultipleParameters.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun foo(p: Int) { "abc".fold(1) { } } diff --git a/idea/idea-completion/testData/weighers/basic/LambdaSignature.kt b/idea/idea-completion/testData/weighers/basic/LambdaSignature.kt index f113d8d1573..7b484afb590 100644 --- a/idea/idea-completion/testData/weighers/basic/LambdaSignature.kt +++ b/idea/idea-completion/testData/weighers/basic/LambdaSignature.kt @@ -1,3 +1,5 @@ +// COMPILER_ARGUMENTS: -XXLanguage:-NewInference + fun String.fold(initial: R, operation: (acc: R, Char) -> R): R = TODO() fun foo(p: Int) { diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/handlers/AbstractCompletionHandlerTests.kt b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/handlers/AbstractCompletionHandlerTests.kt index a8edbdad0db..c261b00c816 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/handlers/AbstractCompletionHandlerTests.kt +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/handlers/AbstractCompletionHandlerTests.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.idea.completion.test.ExpectedCompletionUtils import org.jetbrains.kotlin.idea.completion.test.configureWithExtraFile import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor +import org.jetbrains.kotlin.idea.test.configureCompilerOptions import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.utils.addToStdlib.indexOfOrNull import java.io.File @@ -32,6 +33,9 @@ abstract class AbstractCompletionHandlerTest(private val defaultCompletionType: try { val fileText = FileUtil.loadFile(File(testPath)) assertTrue("\"\" is missing in file \"$testPath\"", fileText.contains("")); + + configureCompilerOptions(fileText, project, module) + val invocationCount = InTextDirectivesUtils.getPrefixedInt(fileText, INVOCATION_COUNT_PREFIX) ?: 1 val lookupString = InTextDirectivesUtils.findStringWithPrefixes(fileText, LOOKUP_STRING_PREFIX) val itemText = InTextDirectivesUtils.findStringWithPrefixes(fileText, ELEMENT_TEXT_PREFIX) diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt index 4e248c61af7..9ce5478d444 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.idea.completion.test.RELATIVE_COMPLETION_TEST_DATA_B import org.jetbrains.kotlin.idea.completion.test.configureWithExtraFile 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.test.InTextDirectivesUtils import org.junit.Assert @@ -23,6 +24,8 @@ abstract class AbstractCompletionWeigherTest(val completionType: CompletionType, val text = myFixture.editor.document.text + configureCompilerOptions(text, project, module) + val items = InTextDirectivesUtils.findArrayWithPrefixes(text, "// ORDER:") Assert.assertTrue("""Some items should be defined with "// ORDER:" directive""", !items.isEmpty())