src/share/classes/com/sun/tools/javac/comp/Check.java
Print this page
rev 108 : 6638712: Inference with wildcard types causes selection of inapplicable method
Summary: Added global sanity check in order to make sure that return type inference does not violate bounds constraints
Reviewed-by: jjg
*** 381,390 ****
--- 381,394 ----
JCDiagnostic d = ex.getDiagnostic();
return typeError(pos,
JCDiagnostic.fragment("incompatible.types" + (d!=null ? ".1" : ""), d),
t, pt);
}
+ } catch (Infer.InvalidInstanceException ex) {
+ JCDiagnostic d = ex.getDiagnostic();
+ log.error(pos, "invalid.inferred.types", t.tvars, d);
+ return syms.errType;
}
}
}
/** Check that a given type can be cast to a given target type.