org.jetbrains.jet.lang.resolve.calls.smartcasts
Class SmartCastUtils

java.lang.Object
  extended by org.jetbrains.jet.lang.resolve.calls.smartcasts.SmartCastUtils

public class SmartCastUtils
extends java.lang.Object


Method Summary
static java.util.List<JetType> getSmartCastVariants(ReceiverValue receiverToCast, BindingContext bindingContext, DataFlowInfo dataFlowInfo)
           
static java.util.List<JetType> getSmartCastVariants(ReceiverValue receiverToCast, ResolutionContext context)
           
static java.util.List<JetType> getSmartCastVariantsExcludingReceiver(BindingContext bindingContext, DataFlowInfo dataFlowInfo, ReceiverValue receiverToCast)
           
static boolean isNotNull(ReceiverValue receiver, BindingContext bindingContext, DataFlowInfo dataFlowInfo)
           
static boolean isSubTypeBySmartCastIgnoringNullability(ReceiverValue receiverArgument, JetType receiverParameterType, ResolutionContext context)
           
static void recordCastOrError(JetExpression expression, JetType type, BindingTrace trace, boolean canBeCasted, boolean recordExpressionType)
           
static boolean recordSmartCastIfNecessary(ReceiverValue receiver, JetType receiverParameterType, ResolutionContext context, boolean safeAccess)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSmartCastVariants

@NotNull
public static java.util.List<JetType> getSmartCastVariants(@NotNull
                                                                   ReceiverValue receiverToCast,
                                                                   @NotNull
                                                                   ResolutionContext context)

getSmartCastVariants

@NotNull
public static java.util.List<JetType> getSmartCastVariants(@NotNull
                                                                   ReceiverValue receiverToCast,
                                                                   @NotNull
                                                                   BindingContext bindingContext,
                                                                   @NotNull
                                                                   DataFlowInfo dataFlowInfo)

getSmartCastVariantsExcludingReceiver

@NotNull
public static java.util.List<JetType> getSmartCastVariantsExcludingReceiver(@NotNull
                                                                                    BindingContext bindingContext,
                                                                                    @NotNull
                                                                                    DataFlowInfo dataFlowInfo,
                                                                                    @NotNull
                                                                                    ReceiverValue receiverToCast)
Returns:
variants @param receiverToCast may be cast to according to @param dataFlowInfo, @param receiverToCast itself is NOT included

isSubTypeBySmartCastIgnoringNullability

public static boolean isSubTypeBySmartCastIgnoringNullability(@NotNull
                                                              ReceiverValue receiverArgument,
                                                              @NotNull
                                                              JetType receiverParameterType,
                                                              @NotNull
                                                              ResolutionContext context)

recordSmartCastIfNecessary

public static boolean recordSmartCastIfNecessary(@NotNull
                                                 ReceiverValue receiver,
                                                 @NotNull
                                                 JetType receiverParameterType,
                                                 @NotNull
                                                 ResolutionContext context,
                                                 boolean safeAccess)

recordCastOrError

public static void recordCastOrError(@NotNull
                                     JetExpression expression,
                                     @NotNull
                                     JetType type,
                                     @NotNull
                                     BindingTrace trace,
                                     boolean canBeCasted,
                                     boolean recordExpressionType)

isNotNull

public static boolean isNotNull(@NotNull
                                ReceiverValue receiver,
                                @NotNull
                                BindingContext bindingContext,
                                @NotNull
                                DataFlowInfo dataFlowInfo)