Refactoring: TypeInfoFactory.createTypeInfo() without type -> noTypeInfo(), getNotNullType -> getTypeNotNull, nullability refined, style fixes

This commit is contained in:
Mikhail Glukhikh
2015-04-21 18:26:26 +03:00
parent 3e1c3e9dfe
commit b40fe9d5ba
18 changed files with 78 additions and 71 deletions
@@ -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);
}
@@ -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