made try, finally and throw expressions implement JetStatementExpression
This commit is contained in:
@@ -140,11 +140,10 @@ public class JetControlFlowProcessor {
|
|||||||
private void checkNothingType(JetElement element) {
|
private void checkNothingType(JetElement element) {
|
||||||
if (!(element instanceof JetExpression)) return;
|
if (!(element instanceof JetExpression)) return;
|
||||||
JetExpression expression = JetPsiUtil.deparenthesize((JetExpression) element);
|
JetExpression expression = JetPsiUtil.deparenthesize((JetExpression) element);
|
||||||
if (expression instanceof JetStatementExpression || expression instanceof JetTryExpression
|
if (expression instanceof JetStatementExpression || expression instanceof JetTryExpression
|
||||||
|| expression instanceof JetThrowExpression || expression instanceof JetFinallySection
|
|| expression instanceof JetIfExpression || expression instanceof JetWhenExpression) {
|
||||||
|| expression instanceof JetIfExpression || expression instanceof JetWhenExpression) return;
|
return;
|
||||||
//noinspection ConstantConditions
|
}
|
||||||
if (!trace.get(BindingContext.PROCESSED, expression)) return;
|
|
||||||
|
|
||||||
JetType type = trace.getBindingContext().get(BindingContext.EXPRESSION_TYPE, expression);
|
JetType type = trace.getBindingContext().get(BindingContext.EXPRESSION_TYPE, expression);
|
||||||
if (type != null && KotlinBuiltIns.getInstance().isNothing(type)) {
|
if (type != null && KotlinBuiltIns.getInstance().isNothing(type)) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import com.intellij.lang.ASTNode;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.JetNodeTypes;
|
import org.jetbrains.jet.JetNodeTypes;
|
||||||
|
|
||||||
public class JetFinallySection extends JetElementImpl {
|
public class JetFinallySection extends JetElementImpl implements JetStatementExpression {
|
||||||
public JetFinallySection(@NotNull ASTNode node) {
|
public JetFinallySection(@NotNull ASTNode node) {
|
||||||
super(node);
|
super(node);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import com.intellij.lang.ASTNode;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
public class JetThrowExpression extends JetExpressionImpl {
|
public class JetThrowExpression extends JetExpressionImpl implements JetStatementExpression {
|
||||||
public JetThrowExpression(@NotNull ASTNode node) {
|
public JetThrowExpression(@NotNull ASTNode node) {
|
||||||
super(node);
|
super(node);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user