org.jetbrains.kotlin.resolve.calls.smartcasts
Class SmartCastUtils

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

public class SmartCastUtils
extends java.lang.Object


Method Summary
static boolean canBeSmartCast(ReceiverParameterDescriptor receiverParameter, ReceiverValue receiver, ResolutionContext context)
           
static java.util.List<JetType> getSmartCastVariants(ReceiverValue receiverToCast, BindingContext bindingContext, DeclarationDescriptor containingDeclarationOrModule, DataFlowInfo dataFlowInfo)
           
static java.util.List<JetType> getSmartCastVariants(ReceiverValue receiverToCast, ResolutionContext context)
           
static java.util.Collection<JetType> getSmartCastVariantsExcludingReceiver(BindingContext bindingContext, DeclarationDescriptor containingDeclarationOrModule, DataFlowInfo dataFlowInfo, ReceiverValue receiverToCast)
           
static java.util.Collection<JetType> getSmartCastVariantsExcludingReceiver(ResolutionContext context, ReceiverValue receiverToCast)
           
static java.util.List<JetType> getSmartCastVariantsWithLessSpecificExcluded(ReceiverValue receiverToCast, BindingContext bindingContext, DeclarationDescriptor containingDeclarationOrModule, DataFlowInfo dataFlowInfo)
           
static boolean isSubTypeBySmartCastIgnoringNullability(ReceiverValue receiverArgument, JetType receiverParameterType, ResolutionContext context)
           
static boolean recordCastOrError(JetExpression expression, JetType type, BindingTrace trace, boolean canBeCast, 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
                                                                   DeclarationDescriptor containingDeclarationOrModule,
                                                                   @NotNull
                                                                   DataFlowInfo dataFlowInfo)

getSmartCastVariantsWithLessSpecificExcluded

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

getSmartCastVariantsExcludingReceiver

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

getSmartCastVariantsExcludingReceiver

@NotNull
public static java.util.Collection<JetType> getSmartCastVariantsExcludingReceiver(@NotNull
                                                                                          BindingContext bindingContext,
                                                                                          @NotNull
                                                                                          DeclarationDescriptor containingDeclarationOrModule,
                                                                                          @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 boolean recordCastOrError(@NotNull
                                        JetExpression expression,
                                        @NotNull
                                        JetType type,
                                        @NotNull
                                        BindingTrace trace,
                                        boolean canBeCast,
                                        boolean recordExpressionType)

canBeSmartCast

public static boolean canBeSmartCast(@NotNull
                                     ReceiverParameterDescriptor receiverParameter,
                                     @NotNull
                                     ReceiverValue receiver,
                                     @NotNull
                                     ResolutionContext context)