--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Sat May 10 00:46:47 2014 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Sat May 10 01:24:35 2014 +0100
@@ -517,6 +517,10 @@
return new ResultInfo(pkind, pt, newContext);
}
+ protected ResultInfo dup(Type newPt, CheckContext newContext) {
+ return new ResultInfo(pkind, newPt, newContext);
+ }
+
@Override
public String toString() {
if (pt != null) {
@@ -2843,7 +2847,8 @@
ResultInfo checkInfo =
resultInfo.dup(newMethodTemplate(
desc.getReturnType().hasTag(VOID) ? Type.noType : desc.getReturnType(),
- that.kind.isUnbound() ? argtypes.tail : argtypes, typeargtypes));
+ that.kind.isUnbound() ? argtypes.tail : argtypes, typeargtypes),
+ new FunctionalReturnContext(resultInfo.checkContext));
Type refType = checkId(that, lookupHelper.site, refSym, localEnv, checkInfo);