org.jetbrains.kotlin.types.expressions
Class ExpressionTypingUtils
java.lang.Object
org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils
public class ExpressionTypingUtils
- extends java.lang.Object
|
Method Summary |
static void |
checkVariableShadowing(ExpressionTypingContext context,
VariableDescriptor variableDescriptor,
VariableDescriptor oldDescriptor)
|
static JetExpression |
createFakeExpressionOfType(com.intellij.openapi.project.Project project,
BindingTrace trace,
java.lang.String argumentName,
JetType argumentType)
|
static boolean |
dependsOnExpectedType(JetExpression expression)
|
static ExpressionReceiver |
getExpressionReceiver(ExpressionTypingFacade facade,
JetExpression expression,
ExpressionTypingContext context)
|
static ExpressionReceiver |
getExpressionReceiver(JetExpression expression,
JetType type)
|
static JetTypeInfo |
getTypeInfoOrNullType(JetExpression expression,
ExpressionTypingContext context,
org.jetbrains.kotlin.types.expressions.ExpressionTypingInternals facade)
|
static java.util.List<JetType> |
getValueParametersTypes(java.util.List<ValueParameterDescriptor> valueParameters)
|
static boolean |
isBinaryExpressionDependentOnExpectedType(JetBinaryExpression expression)
|
static boolean |
isExclExclExpression(JetExpression expression)
|
static boolean |
isLocal(DeclarationDescriptor containerOfTheCurrentLocality,
DeclarationDescriptor candidate)
The primary case for local extensions is the following:
I had a locally declared extension function or a local variable of function type called foo
And I called it on my x
Now, someone added function foo() to the class of x
My code should not change
thus
local extension prevail over members (and members prevail over all non-local extensions) |
static boolean |
isUnaryExpressionDependentOnExpectedType(JetUnaryExpression expression)
|
static ObservableBindingTrace |
makeTraceInterceptingTypeMismatch(BindingTrace trace,
JetElement expressionToWatch,
boolean[] mismatchFound)
|
static LexicalWritableScope |
newWritableScopeImpl(ExpressionTypingContext context,
java.lang.String scopeDebugName)
|
static ReceiverValue |
normalizeReceiverValueForVisibility(ReceiverValue receiverValue,
BindingContext trace)
|
static ExpressionReceiver |
safeGetExpressionReceiver(ExpressionTypingFacade facade,
JetExpression expression,
ExpressionTypingContext context)
|
static JetType |
safeGetType(JetTypeInfo typeInfo)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
normalizeReceiverValueForVisibility
@NotNull
public static ReceiverValue normalizeReceiverValueForVisibility(@NotNull
ReceiverValue receiverValue,
@NotNull
BindingContext trace)
getExpressionReceiver
@Nullable
public static ExpressionReceiver getExpressionReceiver(@NotNull
JetExpression expression,
@Nullable
JetType type)
getExpressionReceiver
@Nullable
public static ExpressionReceiver getExpressionReceiver(@NotNull
ExpressionTypingFacade facade,
@NotNull
JetExpression expression,
ExpressionTypingContext context)
safeGetExpressionReceiver
@NotNull
public static ExpressionReceiver safeGetExpressionReceiver(@NotNull
ExpressionTypingFacade facade,
@NotNull
JetExpression expression,
ExpressionTypingContext context)
safeGetType
@NotNull
public static JetType safeGetType(@NotNull
JetTypeInfo typeInfo)
newWritableScopeImpl
@NotNull
public static LexicalWritableScope newWritableScopeImpl(ExpressionTypingContext context,
@NotNull
java.lang.String scopeDebugName)
createFakeExpressionOfType
public static JetExpression createFakeExpressionOfType(@NotNull
com.intellij.openapi.project.Project project,
@NotNull
BindingTrace trace,
@NotNull
java.lang.String argumentName,
@NotNull
JetType argumentType)
checkVariableShadowing
public static void checkVariableShadowing(@NotNull
ExpressionTypingContext context,
@NotNull
VariableDescriptor variableDescriptor,
@Nullable
VariableDescriptor oldDescriptor)
makeTraceInterceptingTypeMismatch
public static ObservableBindingTrace makeTraceInterceptingTypeMismatch(@NotNull
BindingTrace trace,
@NotNull
JetElement expressionToWatch,
@NotNull
boolean[] mismatchFound)
getTypeInfoOrNullType
@NotNull
public static JetTypeInfo getTypeInfoOrNullType(@Nullable
JetExpression expression,
@NotNull
ExpressionTypingContext context,
@NotNull
org.jetbrains.kotlin.types.expressions.ExpressionTypingInternals facade)
isBinaryExpressionDependentOnExpectedType
public static boolean isBinaryExpressionDependentOnExpectedType(@NotNull
JetBinaryExpression expression)
isUnaryExpressionDependentOnExpectedType
public static boolean isUnaryExpressionDependentOnExpectedType(@NotNull
JetUnaryExpression expression)
isExclExclExpression
public static boolean isExclExclExpression(@Nullable
JetExpression expression)
getValueParametersTypes
@NotNull
public static java.util.List<JetType> getValueParametersTypes(@NotNull
java.util.List<ValueParameterDescriptor> valueParameters)
isLocal
public static boolean isLocal(DeclarationDescriptor containerOfTheCurrentLocality,
DeclarationDescriptor candidate)
- The primary case for local extensions is the following:
I had a locally declared extension function or a local variable of function type called foo
And I called it on my x
Now, someone added function foo() to the class of x
My code should not change
thus
local extension prevail over members (and members prevail over all non-local extensions)
dependsOnExpectedType
public static boolean dependsOnExpectedType(@Nullable
JetExpression expression)