Revert "Add option to enable new inference only for IDE analysis"
This reverts commit36580d46da. #KT-37378 Fixed Original commit:c01a171d4c
This commit is contained in:
@@ -58,7 +58,6 @@ import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.codegen.JvmCodegenUtil
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion.TEST_IS_PRE_RELEASE_SYSTEM_PROPERTY
|
||||
import org.jetbrains.kotlin.config.LanguageVersion
|
||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.incremental.withIC
|
||||
import org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestBase.LibraryDependency.*
|
||||
@@ -626,40 +625,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
|
||||
result.assertSuccessful()
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we're checking that enabling inference in IDE doesn't affect compilation via JPS
|
||||
*
|
||||
* the following two tests are connected:
|
||||
* - testKotlinProjectWithEnabledNewInferenceInIDE checks that project is compiled when new inference is enabled only in IDE
|
||||
* - this is done via project component
|
||||
* - testKotlinProjectWithErrorsBecauseOfNewInference checks that project isn't compiled when new inference is enabled in the compiler
|
||||
*
|
||||
* So, if the former will fail => option affects JPS compilation, it's bad. Also, if the latter test fails => test is useless as it's
|
||||
* compiled with new and old inference.
|
||||
*
|
||||
*/
|
||||
fun testKotlinProjectWithEnabledNewInferenceInIDE() {
|
||||
initProject(JVM_MOCK_RUNTIME)
|
||||
val module = myProject.modules.single()
|
||||
val args = module.kotlinCompilerArguments
|
||||
args.languageVersion = LanguageVersion.KOTLIN_1_3.versionString
|
||||
myProject.kotlinCommonCompilerArguments = args
|
||||
|
||||
buildAllModules().assertSuccessful()
|
||||
}
|
||||
|
||||
fun testKotlinProjectWithErrorsBecauseOfNewInference() {
|
||||
initProject(JVM_MOCK_RUNTIME)
|
||||
val module = myProject.modules.single()
|
||||
val args = module.kotlinCompilerArguments
|
||||
args.newInference = true
|
||||
myProject.kotlinCommonCompilerArguments = args
|
||||
|
||||
val result = buildAllModules()
|
||||
result.assertFailed()
|
||||
result.checkErrors()
|
||||
}
|
||||
|
||||
private fun createKotlinJavaScriptLibraryArchive() {
|
||||
val jarFile = File(workDir, KOTLIN_JS_LIBRARY_JAR)
|
||||
try {
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="kotlinProject" />
|
||||
</component>
|
||||
</module>
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
</component>
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/kotlinProject.iml" filepath="$PROJECT_DIR$/kotlinProject.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA_JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="kotlin.use.new.inference.for.ide.analysis" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,5 +0,0 @@
|
||||
fun foo() {
|
||||
ByteArray(42) {
|
||||
when (Any()) {}
|
||||
}
|
||||
}
|
||||
-1
@@ -1 +0,0 @@
|
||||
Type mismatch: inferred type is Unit but Byte was expected at line 3, column 9
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="kotlinProject" />
|
||||
</component>
|
||||
</module>
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
</component>
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/kotlinProject.iml" filepath="$PROJECT_DIR$/kotlinProject.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA_JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
fun foo() {
|
||||
ByteArray(42) {
|
||||
when (Any()) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user