--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Fri Jun 20 10:56:47 2014 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Fri Jun 20 20:36:54 2014 +0100
@@ -354,6 +354,7 @@
Type to, Attr.ResultInfo resultInfo,
InferenceContext inferenceContext) {
inferenceContext.solve(List.of(from.qtype), new Warner());
+ inferenceContext.notifyChange();
Type capturedType = resultInfo.checkContext.inferenceContext()
.cachedCapture(tree, from.inst, false);
if (types.isConvertible(capturedType,
@@ -450,7 +451,7 @@
class ImplicitArgType extends DeferredAttr.DeferredTypeMap {
public ImplicitArgType(Symbol msym, Resolve.MethodResolutionPhase phase) {
- rs.deferredAttr.super(AttrMode.SPECULATIVE, msym, phase);
+ (rs.deferredAttr).super(AttrMode.SPECULATIVE, msym, phase);
}
public Type apply(Type t) {
@@ -518,6 +519,8 @@
//or if it's not a subtype of the original target, issue an error
checkContext.report(pos, diags.fragment("no.suitable.functional.intf.inst", funcInterface));
}
+ //propagate constraints as per JLS 18.2.1
+ checkContext.compatible(owntype, funcInterface, types.noWarnings);
return owntype;
}
}