org.jetbrains.kotlin.resolve
Class PossiblyBareType

java.lang.Object
  extended by org.jetbrains.kotlin.resolve.PossiblyBareType

public class PossiblyBareType
extends java.lang.Object

Bare types are somewhat like raw types, but in Kotlin they are only allowed on the right-hand side of is/as. For example: fun foo(a: Any) { if (a is List) { // a is known to be List<*> here } } Another example: fun foo(a: Collection) { if (a is List) { // a is known to be List here } } One can call reconstruct(supertype) to get an actual type from a bare type


Method Summary
static PossiblyBareType bare(TypeConstructor bareTypeConstructor, boolean nullable)
           
 KotlinType getActualType()
           
 TypeConstructor getBareTypeConstructor()
           
 boolean isBare()
           
 boolean isNullable()
           
 PossiblyBareType makeNullable()
           
 TypeReconstructionResult reconstruct(KotlinType subjectType)
           
 java.lang.String toString()
           
static PossiblyBareType type(KotlinType actualType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

bare

@NotNull
public static PossiblyBareType bare(@NotNull
                                            TypeConstructor bareTypeConstructor,
                                            boolean nullable)

type

@NotNull
public static PossiblyBareType type(@NotNull
                                            KotlinType actualType)

isBare

public boolean isBare()

getActualType

@NotNull
public KotlinType getActualType()

getBareTypeConstructor

@NotNull
public TypeConstructor getBareTypeConstructor()

isNullable

public boolean isNullable()

makeNullable

public PossiblyBareType makeNullable()

reconstruct

@NotNull
public TypeReconstructionResult reconstruct(@NotNull
                                                    KotlinType subjectType)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object