org.jetbrains.jet.lang.resolve
Class DescriptorResolver

java.lang.Object
  extended by org.jetbrains.jet.lang.resolve.DescriptorResolver

public class DescriptorResolver
extends java.lang.Object


Field Summary
static java.lang.String COMPONENT_FUNCTION_NAME_PREFIX
           
static Name COPY_METHOD_NAME
           
static Name VALUE_OF_METHOD_NAME
           
static Name VALUES_METHOD_NAME
           
 
Constructor Summary
DescriptorResolver()
           
 
Method Summary
static void checkBounds(JetTypeReference typeReference, JetType type, BindingTrace trace)
           
static void checkBounds(JetTypeReference jetTypeArgument, JetType typeArgument, TypeParameterDescriptor typeParameterDescriptor, TypeSubstitutor substitutor, BindingTrace trace)
           
static boolean checkHasOuterClassInstance(JetScope scope, BindingTrace trace, com.intellij.psi.PsiElement reportErrorsOn, ClassDescriptor target)
           
static boolean checkHasOuterClassInstance(JetScope scope, BindingTrace trace, com.intellij.psi.PsiElement reportErrorsOn, ClassDescriptor target, boolean doSuperClassCheck)
           
static void checkParameterHasNoValOrVar(BindingTrace trace, JetParameter parameter, DiagnosticFactory1<com.intellij.psi.PsiElement,JetKeywordToken> diagnosticFactory)
           
static ConstructorDescriptorImpl createAndRecordPrimaryConstructorForObject(com.intellij.psi.PsiElement object, ClassDescriptor classDescriptor, BindingTrace trace)
           
static SimpleFunctionDescriptor createComponentFunctionDescriptor(int parameterIndex, PropertyDescriptor property, ValueParameterDescriptor parameter, ClassDescriptor classDescriptor, BindingTrace trace)
           
static SimpleFunctionDescriptor createCopyFunctionDescriptor(java.util.Collection<ValueParameterDescriptor> constructorParameters, ClassDescriptor classDescriptor, BindingTrace trace)
           
static PropertyGetterDescriptorImpl createDefaultGetter(PropertyDescriptor propertyDescriptor)
           
static PropertySetterDescriptorImpl createDefaultSetter(PropertyDescriptor propertyDescriptor)
           
static SimpleFunctionDescriptor createEnumClassObjectValueOfMethod(ClassDescriptor classObjectDescriptor, BindingTrace trace)
           
static SimpleFunctionDescriptor createEnumClassObjectValuesMethod(ClassDescriptor classObjectDescriptor, BindingTrace trace)
           
static PropertyGetterDescriptorImpl createGetterForDelegatedProperty(PropertyDescriptor propertyDescriptor)
           
static ReceiverParameterDescriptor createLazyReceiverParameterDescriptor(ClassDescriptor classDescriptor)
           
static ConstructorDescriptorImpl createPrimaryConstructorForObject(ClassDescriptor containingClass)
           
static PropertySetterDescriptorImpl createSetterForDelegatedProperty(PropertyDescriptor propertyDescriptor)
           
static Modality getDefaultModality(DeclarationDescriptor containingDescriptor, boolean isBodyPresent)
           
static Visibility getDefaultVisibility(JetModifierListOwner modifierListOwner, DeclarationDescriptor containingDescriptor)
           
 JetScope getPropertyDeclarationInnerScope(PropertyDescriptor propertyDescriptor, JetScope outerScope, java.util.List<? extends TypeParameterDescriptor> typeParameters, ReceiverParameterDescriptor receiver, BindingTrace trace)
           
 JetScope getPropertyDeclarationInnerScopeForInitializer(JetScope outerScope, java.util.List<? extends TypeParameterDescriptor> typeParameters, ReceiverParameterDescriptor receiver, BindingTrace trace)
           
 java.util.Collection<JetType> resolveDelegationSpecifiers(JetScope extensibleScope, java.util.List<JetDelegationSpecifier> delegationSpecifiers, TypeResolver resolver, BindingTrace trace, boolean checkBounds)
           
 SimpleFunctionDescriptor resolveFunctionDescriptor(DeclarationDescriptor containingDescriptor, JetScope scope, JetNamedFunction function, BindingTrace trace, DataFlowInfo dataFlowInfo)
           
 SimpleFunctionDescriptor resolveFunctionDescriptorWithAnnotationArguments(DeclarationDescriptor containingDescriptor, JetScope scope, JetNamedFunction function, BindingTrace trace, DataFlowInfo dataFlowInfo)
           
 void resolveGenericBounds(JetTypeParameterListOwner declaration, JetScope scope, java.util.List<TypeParameterDescriptorImpl> parameters, BindingTrace trace)
           
 VariableDescriptor resolveLocalVariableDescriptor(JetParameter parameter, JetType type, BindingTrace trace, JetScope scope)
           
 VariableDescriptor resolveLocalVariableDescriptor(JetScope scope, JetParameter parameter, BindingTrace trace)
           
 VariableDescriptor resolveLocalVariableDescriptor(JetScope scope, JetVariableDeclaration variable, DataFlowInfo dataFlowInfo, BindingTrace trace)
           
 VariableDescriptorImpl resolveLocalVariableDescriptorWithType(JetScope scope, JetVariableDeclaration variable, JetType type, BindingTrace trace)
           
 void resolveMutableClassDescriptor(JetClass classElement, MutableClassDescriptor descriptor, BindingTrace trace)
           
 VariableDescriptor resolveObjectDeclaration(DeclarationDescriptor containingDeclaration, JetClassOrObject objectDeclaration, ClassDescriptor classDescriptor, BindingTrace trace)
           
 PropertyDescriptor resolveObjectDeclarationAsPropertyDescriptor(DeclarationDescriptor containingDeclaration, JetClassOrObject objectDeclaration, ClassDescriptor classDescriptor, BindingTrace trace)
           
 ConstructorDescriptorImpl resolvePrimaryConstructorDescriptor(JetScope scope, ClassDescriptor classDescriptor, JetClass classElement, BindingTrace trace)
           
 PropertyDescriptor resolvePrimaryConstructorParameterToAProperty(ClassDescriptor classDescriptor, ValueParameterDescriptor valueParameter, JetScope scope, JetParameter parameter, BindingTrace trace)
           
 PropertyDescriptor resolvePropertyDescriptor(DeclarationDescriptor containingDeclaration, JetScope scope, JetProperty property, BindingTrace trace, DataFlowInfo dataFlowInfo)
           
static ReceiverParameterDescriptor resolveReceiverParameterFor(CallableDescriptor owner, JetType receiverParameterType)
           
 java.util.List<JetType> resolveSupertypes(JetScope scope, ClassDescriptor classDescriptor, JetClassOrObject jetClass, BindingTrace trace)
           
 void resolveSupertypesForMutableClassDescriptor(JetClassOrObject jetClass, MutableClassDescriptor descriptor, BindingTrace trace)
           
 java.util.List<TypeParameterDescriptorImpl> resolveTypeParametersForCallableDescriptor(DeclarationDescriptor containingDescriptor, WritableScope extensibleScope, java.util.List<JetTypeParameter> typeParameters, BindingTrace trace)
           
 MutableValueParameterDescriptor resolveValueParameterDescriptor(JetScope scope, DeclarationDescriptor declarationDescriptor, JetParameter valueParameter, int index, JetType type, BindingTrace trace)
           
 MutableValueParameterDescriptor resolveValueParameterDescriptorWithAnnotationArguments(JetScope scope, DeclarationDescriptor declarationDescriptor, JetParameter valueParameter, int index, JetType type, BindingTrace trace)
           
 void setAnnotationResolver(AnnotationResolver annotationResolver)
           
 void setExpressionTypingServices(ExpressionTypingServices expressionTypingServices)
           
 void setTypeResolver(TypeResolver typeResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_OF_METHOD_NAME

public static final Name VALUE_OF_METHOD_NAME

VALUES_METHOD_NAME

public static final Name VALUES_METHOD_NAME

COPY_METHOD_NAME

public static final Name COPY_METHOD_NAME

COMPONENT_FUNCTION_NAME_PREFIX

public static final java.lang.String COMPONENT_FUNCTION_NAME_PREFIX
See Also:
Constant Field Values
Constructor Detail

DescriptorResolver

public DescriptorResolver()
Method Detail

resolveReceiverParameterFor

public static ReceiverParameterDescriptor resolveReceiverParameterFor(@NotNull
                                                                      CallableDescriptor owner,
                                                                      @Nullable
                                                                      JetType receiverParameterType)

setTypeResolver

@Inject
public void setTypeResolver(@NotNull
                                   TypeResolver typeResolver)

setAnnotationResolver

@Inject
public void setAnnotationResolver(@NotNull
                                         AnnotationResolver annotationResolver)

setExpressionTypingServices

@Inject
public void setExpressionTypingServices(@NotNull
                                               ExpressionTypingServices expressionTypingServices)

resolveMutableClassDescriptor

public void resolveMutableClassDescriptor(@NotNull
                                          JetClass classElement,
                                          @NotNull
                                          MutableClassDescriptor descriptor,
                                          BindingTrace trace)

resolveSupertypesForMutableClassDescriptor

public void resolveSupertypesForMutableClassDescriptor(@NotNull
                                                       JetClassOrObject jetClass,
                                                       @NotNull
                                                       MutableClassDescriptor descriptor,
                                                       BindingTrace trace)

resolveSupertypes

public java.util.List<JetType> resolveSupertypes(@NotNull
                                                 JetScope scope,
                                                 @NotNull
                                                 ClassDescriptor classDescriptor,
                                                 @NotNull
                                                 JetClassOrObject jetClass,
                                                 BindingTrace trace)

resolveDelegationSpecifiers

public java.util.Collection<JetType> resolveDelegationSpecifiers(JetScope extensibleScope,
                                                                 java.util.List<JetDelegationSpecifier> delegationSpecifiers,
                                                                 @NotNull
                                                                 TypeResolver resolver,
                                                                 BindingTrace trace,
                                                                 boolean checkBounds)

resolveFunctionDescriptorWithAnnotationArguments

@NotNull
public SimpleFunctionDescriptor resolveFunctionDescriptorWithAnnotationArguments(@NotNull
                                                                                         DeclarationDescriptor containingDescriptor,
                                                                                         @NotNull
                                                                                         JetScope scope,
                                                                                         @NotNull
                                                                                         JetNamedFunction function,
                                                                                         @NotNull
                                                                                         BindingTrace trace,
                                                                                         @NotNull
                                                                                         DataFlowInfo dataFlowInfo)

resolveFunctionDescriptor

@NotNull
public SimpleFunctionDescriptor resolveFunctionDescriptor(@NotNull
                                                                  DeclarationDescriptor containingDescriptor,
                                                                  @NotNull
                                                                  JetScope scope,
                                                                  @NotNull
                                                                  JetNamedFunction function,
                                                                  @NotNull
                                                                  BindingTrace trace,
                                                                  @NotNull
                                                                  DataFlowInfo dataFlowInfo)

createComponentFunctionDescriptor

@NotNull
public static SimpleFunctionDescriptor createComponentFunctionDescriptor(int parameterIndex,
                                                                                 @NotNull
                                                                                 PropertyDescriptor property,
                                                                                 @NotNull
                                                                                 ValueParameterDescriptor parameter,
                                                                                 @NotNull
                                                                                 ClassDescriptor classDescriptor,
                                                                                 @NotNull
                                                                                 BindingTrace trace)

createCopyFunctionDescriptor

@NotNull
public static SimpleFunctionDescriptor createCopyFunctionDescriptor(@NotNull
                                                                            java.util.Collection<ValueParameterDescriptor> constructorParameters,
                                                                            @NotNull
                                                                            ClassDescriptor classDescriptor,
                                                                            @NotNull
                                                                            BindingTrace trace)

getDefaultVisibility

public static Visibility getDefaultVisibility(JetModifierListOwner modifierListOwner,
                                              DeclarationDescriptor containingDescriptor)

getDefaultModality

public static Modality getDefaultModality(DeclarationDescriptor containingDescriptor,
                                          boolean isBodyPresent)

resolveValueParameterDescriptor

@NotNull
public MutableValueParameterDescriptor resolveValueParameterDescriptor(JetScope scope,
                                                                               DeclarationDescriptor declarationDescriptor,
                                                                               JetParameter valueParameter,
                                                                               int index,
                                                                               JetType type,
                                                                               BindingTrace trace)

resolveValueParameterDescriptorWithAnnotationArguments

@NotNull
public MutableValueParameterDescriptor resolveValueParameterDescriptorWithAnnotationArguments(JetScope scope,
                                                                                                      DeclarationDescriptor declarationDescriptor,
                                                                                                      JetParameter valueParameter,
                                                                                                      int index,
                                                                                                      JetType type,
                                                                                                      BindingTrace trace)

resolveTypeParametersForCallableDescriptor

public java.util.List<TypeParameterDescriptorImpl> resolveTypeParametersForCallableDescriptor(DeclarationDescriptor containingDescriptor,
                                                                                              WritableScope extensibleScope,
                                                                                              java.util.List<JetTypeParameter> typeParameters,
                                                                                              BindingTrace trace)

createAndRecordPrimaryConstructorForObject

@NotNull
public static ConstructorDescriptorImpl createAndRecordPrimaryConstructorForObject(@Nullable
                                                                                           com.intellij.psi.PsiElement object,
                                                                                           @NotNull
                                                                                           ClassDescriptor classDescriptor,
                                                                                           @NotNull
                                                                                           BindingTrace trace)

createPrimaryConstructorForObject

@NotNull
public static ConstructorDescriptorImpl createPrimaryConstructorForObject(@NotNull
                                                                                  ClassDescriptor containingClass)

resolveGenericBounds

public void resolveGenericBounds(@NotNull
                                 JetTypeParameterListOwner declaration,
                                 JetScope scope,
                                 java.util.List<TypeParameterDescriptorImpl> parameters,
                                 BindingTrace trace)

resolveLocalVariableDescriptor

@NotNull
public VariableDescriptor resolveLocalVariableDescriptor(@NotNull
                                                                 JetScope scope,
                                                                 @NotNull
                                                                 JetParameter parameter,
                                                                 BindingTrace trace)

resolveLocalVariableDescriptor

public VariableDescriptor resolveLocalVariableDescriptor(@NotNull
                                                         JetParameter parameter,
                                                         @NotNull
                                                         JetType type,
                                                         BindingTrace trace,
                                                         @NotNull
                                                         JetScope scope)

resolveLocalVariableDescriptor

@NotNull
public VariableDescriptor resolveLocalVariableDescriptor(JetScope scope,
                                                                 JetVariableDeclaration variable,
                                                                 DataFlowInfo dataFlowInfo,
                                                                 BindingTrace trace)

resolveLocalVariableDescriptorWithType

@NotNull
public VariableDescriptorImpl resolveLocalVariableDescriptorWithType(@NotNull
                                                                             JetScope scope,
                                                                             @NotNull
                                                                             JetVariableDeclaration variable,
                                                                             @Nullable
                                                                             JetType type,
                                                                             @NotNull
                                                                             BindingTrace trace)

resolveObjectDeclaration

@NotNull
public VariableDescriptor resolveObjectDeclaration(@NotNull
                                                           DeclarationDescriptor containingDeclaration,
                                                           @NotNull
                                                           JetClassOrObject objectDeclaration,
                                                           @NotNull
                                                           ClassDescriptor classDescriptor,
                                                           BindingTrace trace)

resolveObjectDeclarationAsPropertyDescriptor

@NotNull
public PropertyDescriptor resolveObjectDeclarationAsPropertyDescriptor(@NotNull
                                                                               DeclarationDescriptor containingDeclaration,
                                                                               @NotNull
                                                                               JetClassOrObject objectDeclaration,
                                                                               @NotNull
                                                                               ClassDescriptor classDescriptor,
                                                                               BindingTrace trace)

getPropertyDeclarationInnerScope

public JetScope getPropertyDeclarationInnerScope(@NotNull
                                                 PropertyDescriptor propertyDescriptor,
                                                 @NotNull
                                                 JetScope outerScope,
                                                 @NotNull
                                                 java.util.List<? extends TypeParameterDescriptor> typeParameters,
                                                 @Nullable
                                                 ReceiverParameterDescriptor receiver,
                                                 BindingTrace trace)

getPropertyDeclarationInnerScopeForInitializer

public JetScope getPropertyDeclarationInnerScopeForInitializer(@NotNull
                                                               JetScope outerScope,
                                                               @NotNull
                                                               java.util.List<? extends TypeParameterDescriptor> typeParameters,
                                                               @Nullable
                                                               ReceiverParameterDescriptor receiver,
                                                               BindingTrace trace)

resolvePropertyDescriptor

@NotNull
public PropertyDescriptor resolvePropertyDescriptor(@NotNull
                                                            DeclarationDescriptor containingDeclaration,
                                                            @NotNull
                                                            JetScope scope,
                                                            @NotNull
                                                            JetProperty property,
                                                            @NotNull
                                                            BindingTrace trace,
                                                            @NotNull
                                                            DataFlowInfo dataFlowInfo)

createDefaultSetter

@NotNull
public static PropertySetterDescriptorImpl createDefaultSetter(@NotNull
                                                                       PropertyDescriptor propertyDescriptor)

createSetterForDelegatedProperty

@NotNull
public static PropertySetterDescriptorImpl createSetterForDelegatedProperty(@NotNull
                                                                                    PropertyDescriptor propertyDescriptor)

createDefaultGetter

@NotNull
public static PropertyGetterDescriptorImpl createDefaultGetter(@NotNull
                                                                       PropertyDescriptor propertyDescriptor)

createGetterForDelegatedProperty

@NotNull
public static PropertyGetterDescriptorImpl createGetterForDelegatedProperty(@NotNull
                                                                                    PropertyDescriptor propertyDescriptor)

resolvePrimaryConstructorDescriptor

@Nullable
public ConstructorDescriptorImpl resolvePrimaryConstructorDescriptor(@NotNull
                                                                              JetScope scope,
                                                                              @NotNull
                                                                              ClassDescriptor classDescriptor,
                                                                              @NotNull
                                                                              JetClass classElement,
                                                                              BindingTrace trace)

resolvePrimaryConstructorParameterToAProperty

@NotNull
public PropertyDescriptor resolvePrimaryConstructorParameterToAProperty(@NotNull
                                                                                ClassDescriptor classDescriptor,
                                                                                @NotNull
                                                                                ValueParameterDescriptor valueParameter,
                                                                                @NotNull
                                                                                JetScope scope,
                                                                                @NotNull
                                                                                JetParameter parameter,
                                                                                BindingTrace trace)

checkBounds

public static void checkBounds(@NotNull
                               JetTypeReference typeReference,
                               @NotNull
                               JetType type,
                               BindingTrace trace)

checkBounds

public static void checkBounds(@NotNull
                               JetTypeReference jetTypeArgument,
                               @NotNull
                               JetType typeArgument,
                               @NotNull
                               TypeParameterDescriptor typeParameterDescriptor,
                               @NotNull
                               TypeSubstitutor substitutor,
                               BindingTrace trace)

createEnumClassObjectValuesMethod

public static SimpleFunctionDescriptor createEnumClassObjectValuesMethod(@NotNull
                                                                         ClassDescriptor classObjectDescriptor,
                                                                         BindingTrace trace)

createEnumClassObjectValueOfMethod

public static SimpleFunctionDescriptor createEnumClassObjectValueOfMethod(@NotNull
                                                                          ClassDescriptor classObjectDescriptor,
                                                                          BindingTrace trace)

createLazyReceiverParameterDescriptor

public static ReceiverParameterDescriptor createLazyReceiverParameterDescriptor(@NotNull
                                                                                ClassDescriptor classDescriptor)

checkHasOuterClassInstance

public static boolean checkHasOuterClassInstance(@NotNull
                                                 JetScope scope,
                                                 @NotNull
                                                 BindingTrace trace,
                                                 @NotNull
                                                 com.intellij.psi.PsiElement reportErrorsOn,
                                                 @NotNull
                                                 ClassDescriptor target)

checkHasOuterClassInstance

public static boolean checkHasOuterClassInstance(@NotNull
                                                 JetScope scope,
                                                 @NotNull
                                                 BindingTrace trace,
                                                 @NotNull
                                                 com.intellij.psi.PsiElement reportErrorsOn,
                                                 @NotNull
                                                 ClassDescriptor target,
                                                 boolean doSuperClassCheck)

checkParameterHasNoValOrVar

public static void checkParameterHasNoValOrVar(@NotNull
                                               BindingTrace trace,
                                               @NotNull
                                               JetParameter parameter,
                                               @NotNull
                                               DiagnosticFactory1<com.intellij.psi.PsiElement,JetKeywordToken> diagnosticFactory)