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),
kindName(ownkind));
owntype = types.createErrorType(owntype);