Refactoring: TypeInfoFactory.createTypeInfo() without type -> noTypeInfo(), getNotNullType -> getTypeNotNull, nullability refined, style fixes
This commit is contained in:
+1
-1
@@ -356,7 +356,7 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
|
||||
assert right != null;
|
||||
|
||||
JetType rightType = BindingContextUtils.getNotNull(context.bindingContext(), BindingContext.TYPE, right);
|
||||
JetType leftType = BindingContextUtils.getNotNullType(context.bindingContext(), expression.getLeft());
|
||||
JetType leftType = BindingContextUtils.getTypeNotNull(context.bindingContext(), expression.getLeft());
|
||||
if (TypeUtils.isNullableType(rightType) || !TypeUtils.isNullableType(leftType)) {
|
||||
return jsExpression.source(expression);
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public final class UnaryOperationTranslator {
|
||||
IElementType operationToken = expression.getOperationReference().getReferencedNameElementType();
|
||||
if (operationToken == JetTokens.EXCLEXCL) {
|
||||
JetExpression baseExpression = getBaseExpression(expression);
|
||||
JetType type = BindingContextUtils.getNotNullType(context.bindingContext(), baseExpression);
|
||||
JetType type = BindingContextUtils.getTypeNotNull(context.bindingContext(), baseExpression);
|
||||
JsExpression translatedExpression = translateAsExpression(baseExpression, context);
|
||||
return type.isMarkedNullable() ? sure(translatedExpression, context) : translatedExpression;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ public final class BindingUtils {
|
||||
@NotNull
|
||||
public static JetType getTypeForExpression(@NotNull BindingContext context,
|
||||
@NotNull JetExpression expression) {
|
||||
return BindingContextUtils.getNotNullType(context, expression);
|
||||
return BindingContextUtils.getTypeNotNull(context, expression);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user