Skip to content

Commit

Permalink
Java, typres: fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 14, 2017
1 parent f51c75f commit 288ca5d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public final class TypeInferenceResolver {

public static class ResolutionFailed extends RuntimeException {
public static class ResolutionFailedException extends RuntimeException {

}

Expand Down Expand Up @@ -52,7 +52,7 @@ public static JavaTypeDefinition lub(List<JavaTypeDefinition> types) {

for (JavaTypeDefinition type : types) {
if (lci == null) {
throw new ResolutionFailed();
throw new ResolutionFailedException();
}

lci = intersect(lci, type.getAsSuper(erasedSupertype));
Expand All @@ -62,7 +62,7 @@ public static JavaTypeDefinition lub(List<JavaTypeDefinition> types) {
}

if (candidates.isEmpty()) {
throw new ResolutionFailed();
throw new ResolutionFailedException();
}

JavaTypeDefinition result = candidates.get(0);
Expand All @@ -72,7 +72,7 @@ public static JavaTypeDefinition lub(List<JavaTypeDefinition> types) {
result = candidate;
} else if (!MethodTypeResolution.isSubtypeable(result, candidate)) {
// TODO: add support for compound types
throw new ResolutionFailed();
throw new ResolutionFailedException();
} // else: result contains candidate, nothing else to do
}

Expand All @@ -93,7 +93,7 @@ public static JavaTypeDefinition intersect(JavaTypeDefinition first, JavaTypeDef
}
}

throw new ResolutionFailed();
throw new ResolutionFailedException();
}

/**
Expand Down Expand Up @@ -185,7 +185,7 @@ public static Map<Variable, JavaTypeDefinition> resolveVariables(List<Bound> bou
}

if (variablesToResolve == null) {
throw new ResolutionFailed();
throw new ResolutionFailedException();
}

// if there are least upper bounds
Expand All @@ -207,7 +207,7 @@ public static List<JavaTypeDefinition> getLowerBoundsOf(Variable var, List<Bound
if (bound.ruleType() == SUBTYPE && bound.rightVariable() == var) {
// TODO: add support for variables depending on other variables
if (bound.isLeftVariable()) {
throw new ResolutionFailed();
throw new ResolutionFailedException();
}

result.add(bound.leftProper());
Expand Down

0 comments on commit 288ca5d

Please sign in to comment.