Java, typeres: fix PR comments

This commit is contained in:
Bendegúz Nagy
2017-08-17 18:11:37 +02:00
parent bc20be1ed8
commit 80a15c7851
2 changed files with 5 additions and 4 deletions

View File

@ -40,10 +40,12 @@ public class ASTExpression extends AbstractJavaTypeNode {
ASTLiteral literal = primaryPrefix.getFirstChildOfType(ASTLiteral.class);
if (literal == null || literal.jjtGetNumChildren() != 0) {
if (literal == null || literal.isStringLiteral()
|| (literal.jjtGetNumChildren() != 0 && literal.jjtGetChild(0) instanceof ASTNullLiteral)) {
return false;
}
// byte, short, char, int, long, float, double, boolean
return true;
}
}

View File

@ -37,9 +37,8 @@ public final class TypeInferenceResolver {
List<Bound> newBounds = new ArrayList<>();
while (!constraints.isEmpty()) {
List<BoundOrConstraint> reduceResult = constraints.get(constraints.size() - 1).reduce();
constraints.remove(constraints.size() - 1);
List<BoundOrConstraint> reduceResult = constraints.remove(constraints.size() - 1).reduce();
for (BoundOrConstraint boundOrConstraint : reduceResult) {
if (boundOrConstraint instanceof Bound) {
newBounds.add((Bound) boundOrConstraint);