[JS CLI] revert disabling NI by default

This commit is contained in:
Zalim Bashorov
2020-03-02 18:36:36 +03:00
parent 5188bc6584
commit 415893b8aa
2 changed files with 2 additions and 58 deletions
@@ -1,38 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.cli.js
import org.jetbrains.kotlin.config.*
class JSLanguageVersionSettings(private val delegate: LanguageVersionSettings) : LanguageVersionSettings {
companion object {
private val disabledFeatures = setOf(
LanguageFeature.NewInference,
LanguageFeature.FunctionalInterfaceConversion,
LanguageFeature.SamConversionForKotlinFunctions,
LanguageFeature.SamConversionPerArgument,
LanguageFeature.FunctionReferenceWithDefaultValueAsOtherType,
LanguageFeature.NonStrictOnlyInputTypesChecks
)
}
override fun getFeatureSupport(feature: LanguageFeature): LanguageFeature.State {
return if (feature in disabledFeatures)
LanguageFeature.State.DISABLED
else
delegate.getFeatureSupport(feature)
}
override fun isPreRelease(): Boolean = delegate.isPreRelease()
override fun <T> getFlag(flag: AnalysisFlag<T>): T = delegate.getFlag(flag)
override val apiVersion: ApiVersion
get() = delegate.apiVersion
override val languageVersion: LanguageVersion
get() = delegate.languageVersion
}
@@ -1,17 +1,6 @@
/* /*
* Copyright 2010-2017 JetBrains s.r.o. * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package org.jetbrains.kotlin.cli.js; package org.jetbrains.kotlin.cli.js;
@@ -246,13 +235,6 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
configuration.put(CommonConfigurationKeys.MODULE_NAME, FileUtil.getNameWithoutExtension(outputFile)); configuration.put(CommonConfigurationKeys.MODULE_NAME, FileUtil.getNameWithoutExtension(outputFile));
if (!arguments.getNewInference()) {
CommonConfigurationKeysKt.setLanguageVersionSettings(
configuration,
new JSLanguageVersionSettings(CommonConfigurationKeysKt.getLanguageVersionSettings(configuration))
);
}
JsConfig config = new JsConfig(project, configuration); JsConfig config = new JsConfig(project, configuration);
JsConfig.Reporter reporter = new JsConfig.Reporter() { JsConfig.Reporter reporter = new JsConfig.Reporter() {
@Override @Override