Search in sources :

Example 1 with PrimitiveType

use of org.jetbrains.kotlin.builtins.PrimitiveType in project kotlin by JetBrains.

the class PatternTranslator method equalityType.

@NotNull
private static EqualityType equalityType(@NotNull KotlinType type) {
    DeclarationDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
    if (!(descriptor instanceof ClassDescriptor))
        return EqualityType.GENERAL;
    PrimitiveType primitive = KotlinBuiltIns.getPrimitiveTypeByFqName(DescriptorUtilsKt.getFqNameUnsafe(descriptor));
    if (primitive == null)
        return EqualityType.GENERAL;
    return primitive == PrimitiveType.LONG ? EqualityType.LONG : EqualityType.PRIMITIVE;
}
Also used : PrimitiveType(org.jetbrains.kotlin.builtins.PrimitiveType) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with PrimitiveType

use of org.jetbrains.kotlin.builtins.PrimitiveType in project kotlin by JetBrains.

the class ProgressionIteratorBasicValue method byProgressionClassType.

@Nullable
public static ProgressionIteratorBasicValue byProgressionClassType(@NotNull Type progressionClassType) {
    FqName classFqName = new FqName(progressionClassType.getClassName());
    PrimitiveType elementType = RangeCodegenUtil.getPrimitiveRangeOrProgressionElementType(classFqName);
    return ITERATOR_VALUE_BY_ELEMENT_PRIMITIVE_TYPE.get(elementType);
}
Also used : FqName(org.jetbrains.kotlin.name.FqName) PrimitiveType(org.jetbrains.kotlin.builtins.PrimitiveType) JvmPrimitiveType(org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PrimitiveType (org.jetbrains.kotlin.builtins.PrimitiveType)2 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1 FqName (org.jetbrains.kotlin.name.FqName)1 JvmPrimitiveType (org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType)1