*/
Type check(final JCTree tree, final Type found, final int ownkind, final ResultInfo resultInfo) {
InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
Type owntype = found;
if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
if (allowPoly && inferenceContext.free(found)) {
if ((ownkind & ~resultInfo.pkind) == 0) {
owntype = resultInfo.check(tree, inferenceContext.asFree(owntype));
} else {
log.error(tree.pos(), "unexpected.type",
kindNames(resultInfo.pkind),