Add a temporary hack for migration "jet" -> "kotlin"
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* 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.jet.lang.types.lang;
|
||||
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
|
||||
// This is a temporary hack for migration of built-ins from package "jet" to "kotlin"
|
||||
public class BuiltInsPackageMigration {
|
||||
public static boolean isSerializingBuiltInsInKotlinPackage = false;
|
||||
|
||||
public static JetType anyType = null;
|
||||
public static JetType stringType = null;
|
||||
public static JetType annotationType = null;
|
||||
public static ClassDescriptor arrayClass = null;
|
||||
public static ClassDescriptor enumClass = null;
|
||||
}
|
||||
@@ -291,6 +291,9 @@ public class KotlinBuiltIns {
|
||||
|
||||
@NotNull
|
||||
public ClassDescriptor getArray() {
|
||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
||||
return BuiltInsPackageMigration.arrayClass;
|
||||
}
|
||||
return getBuiltInClassByName("Array");
|
||||
}
|
||||
|
||||
@@ -395,6 +398,9 @@ public class KotlinBuiltIns {
|
||||
|
||||
@NotNull
|
||||
public ClassDescriptor getEnum() {
|
||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
||||
return BuiltInsPackageMigration.enumClass;
|
||||
}
|
||||
return getBuiltInClassByName("Enum");
|
||||
}
|
||||
|
||||
@@ -571,6 +577,9 @@ public class KotlinBuiltIns {
|
||||
|
||||
@NotNull
|
||||
public JetType getAnyType() {
|
||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
||||
return BuiltInsPackageMigration.anyType;
|
||||
}
|
||||
return getBuiltInTypeByClassName("Any");
|
||||
}
|
||||
|
||||
@@ -642,6 +651,9 @@ public class KotlinBuiltIns {
|
||||
|
||||
@NotNull
|
||||
public JetType getStringType() {
|
||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
||||
return BuiltInsPackageMigration.stringType;
|
||||
}
|
||||
return getBuiltInTypeByClassName("String");
|
||||
}
|
||||
|
||||
@@ -705,6 +717,9 @@ public class KotlinBuiltIns {
|
||||
|
||||
@NotNull
|
||||
public JetType getAnnotationType() {
|
||||
if (BuiltInsPackageMigration.isSerializingBuiltInsInKotlinPackage) {
|
||||
return BuiltInsPackageMigration.annotationType;
|
||||
}
|
||||
return getBuiltInTypeByClassName("Annotation");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user