Add util method to BuildIns is kotlin.Function type.

This commit is contained in:
Stanislav Erokhin
2017-05-18 14:25:49 +03:00
committed by Mikhail Zarechenskiy
parent acc6e48172
commit ff6a28b64c
@@ -275,6 +275,8 @@ public abstract class KotlinBuiltIns {
public final FqNameUnsafe _enum = fqNameUnsafe("Enum");
public final FqNameUnsafe functionSupertype = fqNameUnsafe("Function");
public final FqName throwable = fqName("Throwable");
@@ -1094,6 +1096,10 @@ public abstract class KotlinBuiltIns {
return false;
}
public static boolean isNotNullOrNullableFunctionSupertype(@NotNull KotlinType type) {
return isConstructedFromGivenClass(type, FQ_NAMES.functionSupertype);
}
public static FqName getPrimitiveFqName(@NotNull PrimitiveType primitiveType) {
return BUILT_INS_PACKAGE_FQ_NAME.child(primitiveType.getTypeName());
}