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(LexicalScope scope,
BindingTrace trace,
VariableDescriptor variableDescriptor)
|
static KtExpression |
createFakeExpressionOfType(com.intellij.openapi.project.Project project,
BindingTrace trace,
java.lang.String argumentName,
KotlinType argumentType)
|
static boolean |
dependsOnExpectedType(KtExpression expression)
|
static ExpressionReceiver |
getExpressionReceiver(ExpressionTypingFacade facade,
KtExpression expression,
ExpressionTypingContext context)
|
static KotlinTypeInfo |
getTypeInfoOrNullType(KtExpression expression,
ExpressionTypingContext context,
org.jetbrains.kotlin.types.expressions.ExpressionTypingInternals facade)
|
static java.util.List<KotlinType> |
getValueParametersTypes(java.util.List<ValueParameterDescriptor> valueParameters)
|
static boolean |
isBinaryExpressionDependentOnExpectedType(KtBinaryExpression expression)
|
static boolean |
isExclExclExpression(KtExpression expression)
|
static boolean |
isFunctionExpression(DeclarationDescriptor descriptor)
|
static boolean |
isFunctionLiteral(DeclarationDescriptor descriptor)
|
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 |
isLocalFunction(DeclarationDescriptor descriptor)
|
static boolean |
isUnaryExpressionDependentOnExpectedType(KtUnaryExpression expression)
|
static ObservableBindingTrace |
makeTraceInterceptingTypeMismatch(BindingTrace trace,
KtElement expressionToWatch,
boolean[] mismatchFound)
|
static LexicalWritableScope |
newWritableScopeImpl(ExpressionTypingContext context,
LexicalScopeKind scopeKind)
|
static ExpressionReceiver |
safeGetExpressionReceiver(ExpressionTypingFacade facade,
KtExpression expression,
ExpressionTypingContext context)
|
static KotlinType |
safeGetType(KotlinTypeInfo typeInfo)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getExpressionReceiver
@Nullable
public static ExpressionReceiver getExpressionReceiver(@NotNull
ExpressionTypingFacade facade,
@NotNull
KtExpression expression,
ExpressionTypingContext context)
safeGetExpressionReceiver
@NotNull
public static ExpressionReceiver safeGetExpressionReceiver(@NotNull
ExpressionTypingFacade facade,
@NotNull
KtExpression expression,
ExpressionTypingContext context)
safeGetType
@NotNull
public static KotlinType safeGetType(@NotNull
KotlinTypeInfo typeInfo)
newWritableScopeImpl
@NotNull
public static LexicalWritableScope newWritableScopeImpl(ExpressionTypingContext context,
@NotNull
LexicalScopeKind scopeKind)
createFakeExpressionOfType
public static KtExpression createFakeExpressionOfType(@NotNull
com.intellij.openapi.project.Project project,
@NotNull
BindingTrace trace,
@NotNull
java.lang.String argumentName,
@NotNull
KotlinType argumentType)
checkVariableShadowing
public static void checkVariableShadowing(@NotNull
LexicalScope scope,
@NotNull
BindingTrace trace,
@NotNull
VariableDescriptor variableDescriptor)
makeTraceInterceptingTypeMismatch
public static ObservableBindingTrace makeTraceInterceptingTypeMismatch(@NotNull
BindingTrace trace,
@NotNull
KtElement expressionToWatch,
@NotNull
boolean[] mismatchFound)
getTypeInfoOrNullType
@NotNull
public static KotlinTypeInfo getTypeInfoOrNullType(@Nullable
KtExpression expression,
@NotNull
ExpressionTypingContext context,
@NotNull
org.jetbrains.kotlin.types.expressions.ExpressionTypingInternals facade)
isBinaryExpressionDependentOnExpectedType
public static boolean isBinaryExpressionDependentOnExpectedType(@NotNull
KtBinaryExpression expression)
isUnaryExpressionDependentOnExpectedType
public static boolean isUnaryExpressionDependentOnExpectedType(@NotNull
KtUnaryExpression expression)
isExclExclExpression
public static boolean isExclExclExpression(@Nullable
KtExpression expression)
getValueParametersTypes
@NotNull
public static java.util.List<KotlinType> 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
KtExpression expression)
isFunctionLiteral
public static boolean isFunctionLiteral(@Nullable
DeclarationDescriptor descriptor)
isLocalFunction
public static boolean isLocalFunction(@Nullable
DeclarationDescriptor descriptor)
isFunctionExpression
public static boolean isFunctionExpression(@Nullable
DeclarationDescriptor descriptor)