summaryrefslogtreecommitdiff
path: root/sources/scalac/typechecker/Infer.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/typechecker/Infer.java')
-rw-r--r--sources/scalac/typechecker/Infer.java53
1 files changed, 26 insertions, 27 deletions
diff --git a/sources/scalac/typechecker/Infer.java b/sources/scalac/typechecker/Infer.java
index 30ed7086a4..c14515f841 100644
--- a/sources/scalac/typechecker/Infer.java
+++ b/sources/scalac/typechecker/Infer.java
@@ -449,39 +449,38 @@ public class Infer implements Modifiers, Kinds {
: !upper;
tvars[i] = Type.NoType;
Type bound = up ? tparams[i].info() : tparams[i].loBound();
- if (up && bound.symbol() != Global.instance.definitions.ANY_CLASS ||
- !up && bound.symbol() != Global.instance.definitions.ALL_CLASS) {
- boolean cyclic = false;
- for (int j = 0; j < tvars.length; j++) {
- if (bound.contains(tparams[j]) ||
- up && tparams[j].loBound().isSameAs(tparams[i].type()) ||
- !up && tparams[j].info().isSameAs(tparams[i].type())) {
- cyclic |= tvars[j] == Type.NoType;
- solve(tparams, upper, variances, tvars, j);
- }
+ boolean cyclic = false;
+ for (int j = 0; j < tvars.length; j++) {
+ if (bound.contains(tparams[j]) ||
+ up && tparams[j].loBound().isSameAs(tparams[i].type()) ||
+ !up && tparams[j].info().isSameAs(tparams[i].type())) {
+ cyclic |= tvars[j] == Type.NoType;
+ solve(tparams, upper, variances, tvars, j);
}
- if (!cyclic) {
- if (up) {
+ }
+ if (!cyclic) {
+ if (up) {
+ if (bound.symbol() != Global.instance.definitions.ANY_CLASS)
constr.hibounds = new Type.List(
bound.subst(tparams, tvars), constr.hibounds);
- for (int j = 0; j < tvars.length; j++) {
- if (tparams[j].loBound().isSameAs(
- tparams[i].type())) {
- constr.hibounds = new Type.List(
- tparams[j].type().subst(tparams, tvars),
- constr.hibounds);
- }
+ for (int j = 0; j < tvars.length; j++) {
+ if (tparams[j].loBound().isSameAs(
+ tparams[i].type())) {
+ constr.hibounds = new Type.List(
+ tparams[j].type().subst(tparams, tvars),
+ constr.hibounds);
}
- } else {
+ }
+ } else {
+ if (bound.symbol() != Global.instance.definitions.ALL_CLASS)
constr.lobounds = new Type.List(
bound.subst(tparams, tvars), constr.lobounds);
- for (int j = 0; j < tvars.length; j++) {
- if (tparams[j].info().isSameAs(
- tparams[i].type())) {
- constr.lobounds = new Type.List(
- tparams[j].type().subst(tparams, tvars),
- constr.lobounds);
- }
+ for (int j = 0; j < tvars.length; j++) {
+ if (tparams[j].info().isSameAs(
+ tparams[i].type())) {
+ constr.lobounds = new Type.List(
+ tparams[j].type().subst(tparams, tvars),
+ constr.lobounds);
}
}
}