src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java

changeset 1940
b8610a65fbf9
parent 1882
39ec5d8a691b
child 1969
7de231613e4a
equal deleted inserted replaced
1936:33294f02c9a5 1940:b8610a65fbf9
471 return make.Block(0, stats.toList()); 471 return make.Block(0, stats.toList());
472 } else { 472 } else {
473 //non-void to non-void conversion: 473 //non-void to non-void conversion:
474 // return (TYPE)BODY; 474 // return (TYPE)BODY;
475 JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype); 475 JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype);
476 return make.Block(0, List.<JCStatement>of(make.Return(retExpr))); 476 return make.at(retExpr).Block(0, List.<JCStatement>of(make.Return(retExpr)));
477 } 477 }
478 } 478 }
479 479
480 private JCBlock makeLambdaStatementBody(JCBlock block, final JCMethodDecl lambdaMethodDecl, boolean completeNormally) { 480 private JCBlock makeLambdaStatementBody(JCBlock block, final JCMethodDecl lambdaMethodDecl, boolean completeNormally) {
481 final Type restype = lambdaMethodDecl.type.getReturnType(); 481 final Type restype = lambdaMethodDecl.type.getReturnType();

mercurial