equal
deleted
inserted
replaced
216 Assert.check(allowGraphInference || !resultInfo.checkContext.inferenceContext().free(to), |
216 Assert.check(allowGraphInference || !resultInfo.checkContext.inferenceContext().free(to), |
217 "legacy inference engine cannot handle constraints on both sides of a subtyping assertion"); |
217 "legacy inference engine cannot handle constraints on both sides of a subtyping assertion"); |
218 //we need to skip capture? |
218 //we need to skip capture? |
219 Warner retWarn = new Warner(); |
219 Warner retWarn = new Warner(); |
220 if (!resultInfo.checkContext.compatible(qtype1, resultInfo.checkContext.inferenceContext().asFree(to), retWarn) || |
220 if (!resultInfo.checkContext.compatible(qtype1, resultInfo.checkContext.inferenceContext().asFree(to), retWarn) || |
221 //unchecked conversion is not allowed |
221 //unchecked conversion is not allowed in source 7 mode |
222 retWarn.hasLint(Lint.LintCategory.UNCHECKED)) { |
222 (!allowGraphInference && retWarn.hasLint(Lint.LintCategory.UNCHECKED))) { |
223 throw inferenceException |
223 throw inferenceException |
224 .setMessage("infer.no.conforming.instance.exists", |
224 .setMessage("infer.no.conforming.instance.exists", |
225 inferenceContext.restvars(), mt.getReturnType(), to); |
225 inferenceContext.restvars(), mt.getReturnType(), to); |
226 } |
226 } |
227 } |
227 } |