org.jetbrains.kotlin.resolve
Class BindingContextUtils

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

public class BindingContextUtils
extends java.lang.Object


Method Summary
static VariableDescriptor extractVariableDescriptorIfAny(BindingContext bindingContext, JetElement element, boolean onlyReference)
           
static com.intellij.openapi.util.Pair<FunctionDescriptor,com.intellij.psi.PsiElement> getContainingFunctionSkipFunctionLiterals(DeclarationDescriptor startDescriptor, boolean strict)
           
static ResolvedCall<ConstructorDescriptor> getDelegationConstructorCall(BindingContext bindingContext, ConstructorDescriptor constructorDescriptor)
           
static DeclarationDescriptor getEnclosingDescriptor(BindingContext context, JetElement element)
           
static FunctionDescriptor getEnclosingFunctionDescriptor(BindingContext context, JetElement element)
           
static
<K,V> V
getNotNull(BindingContext bindingContext, ReadOnlySlice<K,V> slice, K key)
           
static
<K,V> V
getNotNull(BindingContext bindingContext, ReadOnlySlice<K,V> slice, K key, java.lang.String messageIfNull)
           
static JetTypeInfo getRecordedTypeInfo(JetExpression expression, BindingContext context)
           
static JetType getTypeNotNull(BindingContext bindingContext, JetExpression expression)
           
static boolean isExpressionWithValidReference(JetExpression expression, BindingContext context)
           
static boolean isVarCapturedInClosure(BindingContext bindingContext, DeclarationDescriptor descriptor)
           
static void recordFunctionDeclarationToDescriptor(BindingTrace trace, com.intellij.psi.PsiElement psiElement, SimpleFunctionDescriptor function)
           
static void reportAmbiguousLabel(BindingTrace trace, JetSimpleNameExpression targetLabel, java.util.Collection<DeclarationDescriptor> declarationsByLabel)
           
static JetType updateRecordedType(JetType type, JetExpression expression, BindingTrace trace, boolean shouldBeMadeNullable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extractVariableDescriptorIfAny

@Nullable
public static VariableDescriptor extractVariableDescriptorIfAny(@NotNull
                                                                         BindingContext bindingContext,
                                                                         @Nullable
                                                                         JetElement element,
                                                                         boolean onlyReference)

recordFunctionDeclarationToDescriptor

public static void recordFunctionDeclarationToDescriptor(@NotNull
                                                         BindingTrace trace,
                                                         @NotNull
                                                         com.intellij.psi.PsiElement psiElement,
                                                         @NotNull
                                                         SimpleFunctionDescriptor function)

getNotNull

@NotNull
public static <K,V> V getNotNull(@NotNull
                                         BindingContext bindingContext,
                                         @NotNull
                                         ReadOnlySlice<K,V> slice,
                                         @NotNull
                                         K key)

getTypeNotNull

@NotNull
public static JetType getTypeNotNull(@NotNull
                                             BindingContext bindingContext,
                                             @NotNull
                                             JetExpression expression)

getNotNull

@NotNull
public static <K,V> V getNotNull(@NotNull
                                         BindingContext bindingContext,
                                         @NotNull
                                         ReadOnlySlice<K,V> slice,
                                         @NotNull
                                         K key,
                                         @NotNull
                                         java.lang.String messageIfNull)

getEnclosingDescriptor

@NotNull
public static DeclarationDescriptor getEnclosingDescriptor(@NotNull
                                                                   BindingContext context,
                                                                   @NotNull
                                                                   JetElement element)

getEnclosingFunctionDescriptor

public static FunctionDescriptor getEnclosingFunctionDescriptor(@NotNull
                                                                BindingContext context,
                                                                @NotNull
                                                                JetElement element)

reportAmbiguousLabel

public static void reportAmbiguousLabel(@NotNull
                                        BindingTrace trace,
                                        @NotNull
                                        JetSimpleNameExpression targetLabel,
                                        @NotNull
                                        java.util.Collection<DeclarationDescriptor> declarationsByLabel)

updateRecordedType

@Nullable
public static JetType updateRecordedType(@Nullable
                                                  JetType type,
                                                  @NotNull
                                                  JetExpression expression,
                                                  @NotNull
                                                  BindingTrace trace,
                                                  boolean shouldBeMadeNullable)

getRecordedTypeInfo

@Nullable
public static JetTypeInfo getRecordedTypeInfo(@NotNull
                                                       JetExpression expression,
                                                       @NotNull
                                                       BindingContext context)

isExpressionWithValidReference

public static boolean isExpressionWithValidReference(@NotNull
                                                     JetExpression expression,
                                                     @NotNull
                                                     BindingContext context)

isVarCapturedInClosure

public static boolean isVarCapturedInClosure(BindingContext bindingContext,
                                             DeclarationDescriptor descriptor)

getContainingFunctionSkipFunctionLiterals

@NotNull
public static com.intellij.openapi.util.Pair<FunctionDescriptor,com.intellij.psi.PsiElement> getContainingFunctionSkipFunctionLiterals(@Nullable
                                                                                                                                               DeclarationDescriptor startDescriptor,
                                                                                                                                               boolean strict)

getDelegationConstructorCall

@Nullable
public static ResolvedCall<ConstructorDescriptor> getDelegationConstructorCall(@NotNull
                                                                                        BindingContext bindingContext,
                                                                                        @NotNull
                                                                                        ConstructorDescriptor constructorDescriptor)