Remove unreachable code

This commit is contained in:
Wojciech Lopata
2013-04-24 11:38:10 +02:00
parent 5baa10df41
commit b5bbe26583
@@ -133,13 +133,6 @@ public class JetFlowInformationProvider {
List<JetElement> returnedExpressions = Lists.newArrayList();
collectReturnExpressions(returnedExpressions);
boolean nothingReturned = returnedExpressions.isEmpty();
returnedExpressions.remove(function); // This will be the only "expression" if the body is empty
if (expectedReturnType != NO_EXPECTED_TYPE && !KotlinBuiltIns.getInstance().isUnit(expectedReturnType) && returnedExpressions.isEmpty() && !nothingReturned) {
trace.report(RETURN_TYPE_MISMATCH.on(bodyExpression, expectedReturnType));
}
final boolean blockBody = function.hasBlockBody();
final Set<JetElement> rootUnreachableElements = collectUnreachableCode();