Add util method to BuildIns is kotlin.Function type.
This commit is contained in:
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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user