Do not use LanguageVersionSettings.languageVersion directly

This commit is contained in:
Alexander Udalov
2017-02-03 13:21:50 +03:00
parent b784680fe2
commit 389ddf26b3
4 changed files with 11 additions and 8 deletions
@@ -51,7 +51,6 @@ import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.codegen.when.SwitchCodegen;
import org.jetbrains.kotlin.codegen.when.SwitchCodegenUtil;
import org.jetbrains.kotlin.config.ApiVersion;
import org.jetbrains.kotlin.config.LanguageVersion;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor;
import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor;
@@ -145,8 +144,6 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
private boolean shouldMarkLineNumbers = true;
private int finallyDepth = 0;
private static final ApiVersion apiVersion1_1 = ApiVersion.createByLanguageVersion(LanguageVersion.KOTLIN_1_1);
public ExpressionCodegen(
@NotNull MethodVisitor mv,
@NotNull FrameMap frameMap,
@@ -3656,8 +3653,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
// of version 1.0 is used and the user forgot to explicitly specify language version / API version.
// This should be enabled when/if we decide to drop support for "-language-version 1.0" / "-api-version 1.0"
//noinspection ConstantConditions, PointlessBooleanExpression
if (false && state.getLanguageVersionSettings().getLanguageVersion() != LanguageVersion.KOTLIN_1_0 &&
state.getLanguageVersionSettings().getApiVersion().compareTo(apiVersion1_1) >= 0) {
if (false && state.getLanguageVersionSettings().getApiVersion().compareTo(ApiVersion.KOTLIN_1_1) >= 0) {
return StackValue.operation(Type.BOOLEAN_TYPE, new Function1<InstructionAdapter, Unit>() {
@Override
public Unit invoke(InstructionAdapter v) {