summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-05-21 16:27:48 +0000
committerMartin Odersky <odersky@gmail.com>2003-05-21 16:27:48 +0000
commitd62458f59a537908a42c4f650ef5973ba5b0b449 (patch)
tree0a58a2738b1f91cd0d5c84afdab99df343d8b35d /sources
parent2cc25288dd36b43c66ee4448856851ede5e8d6b2 (diff)
downloadscala-d62458f59a537908a42c4f650ef5973ba5b0b449.tar.gz
scala-d62458f59a537908a42c4f650ef5973ba5b0b449.tar.bz2
scala-d62458f59a537908a42c4f650ef5973ba5b0b449.zip
*** empty log message ***
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/typechecker/Analyzer.java2
-rw-r--r--sources/scalac/typechecker/Infer.java31
2 files changed, 28 insertions, 5 deletions
diff --git a/sources/scalac/typechecker/Analyzer.java b/sources/scalac/typechecker/Analyzer.java
index cf8accc05c..2bec0ab167 100644
--- a/sources/scalac/typechecker/Analyzer.java
+++ b/sources/scalac/typechecker/Analyzer.java
@@ -1835,8 +1835,6 @@ public class Analyzer extends Transformer implements Modifiers, Kinds {
/** The main attribution function
*/
public Tree transform(Tree tree) {
- if ((mode & PATTERNmode) != 0)
- new TextTreePrinter().print("transofrming(" + pt + ")").print(tree).println().end();//debug
Symbol sym = tree.symbol();
if (sym != null && !sym.isInitialized()) sym.initialize();
if (global.debug && TreeInfo.isDefinition(tree)) global.log("transforming " + sym);
diff --git a/sources/scalac/typechecker/Infer.java b/sources/scalac/typechecker/Infer.java
index c08852766d..5170292d10 100644
--- a/sources/scalac/typechecker/Infer.java
+++ b/sources/scalac/typechecker/Infer.java
@@ -331,9 +331,17 @@ public class Infer implements Modifiers, Kinds {
solveUpper(tparams, tvars, j);
}
}
- if (!cyclic)
+ if (!cyclic) {
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);
+ }
+ }
+ }
maximizeVar(tvar);
tvars[i] = ((Type.TypeVar) tvar).constr.inst;
}
@@ -345,7 +353,6 @@ public class Infer implements Modifiers, Kinds {
private void solveLower(Symbol[] tparams, Type[] tvars, int i)
throws NoInstance {
if (tvars[i] != Type.NoType) {
- //System.out.println("solve lower " + tparams[i]);//DEBUG
switch (tvars[i]) {
case TypeVar(Type origin, Type.Constraint constr):
if (constr.inst != Type.NoType) {
@@ -364,12 +371,30 @@ public class Infer implements Modifiers, Kinds {
}
}
assert !cyclic;
- if (!cyclic)
+ if (!cyclic) {
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 (bound.contains(tparams[j]) ||
+ tparams[j].info().isSameAs(tparams[i].type())) {
+ cyclic |= tvars[j] == Type.NoType;
+ solveLower(tparams, tvars, j);
+ }
+ }
+
+
}
minimizeVar(tvar);
tvars[i] = ((Type.TypeVar) tvar).constr.inst;
+ //System.out.println("solve lower " + tparams[i] + "=" + tvars[i]);//DEBUG
}
}
}