Minor: simplify expression

This commit is contained in:
Stanislav Erokhin
2015-02-12 13:53:38 +03:00
parent 8ea9d39e98
commit def81d30dc
@@ -311,7 +311,7 @@ public class ExpressionTypingServices {
@NotNull CoercionStrategy coercionStrategyForLastExpression,
@NotNull ExpressionTypingInternals blockLevelVisitor
) {
if (!noExpectedType(context.expectedType) || context.expectedType == UNIT_EXPECTED_TYPE) {
if (context.expectedType != NO_EXPECTED_TYPE) {
JetType expectedType;
if (context.expectedType == UNIT_EXPECTED_TYPE ||//the first check is necessary to avoid invocation 'isUnit(UNIT_EXPECTED_TYPE)'
(coercionStrategyForLastExpression == COERCION_TO_UNIT && KotlinBuiltIns.isUnit(context.expectedType))) {