equal
deleted
inserted
replaced
1444 /** |
1444 /** |
1445 * Inference variable bound kinds |
1445 * Inference variable bound kinds |
1446 */ |
1446 */ |
1447 public enum InferenceBound { |
1447 public enum InferenceBound { |
1448 /** upper bounds */ |
1448 /** upper bounds */ |
1449 UPPER, |
1449 UPPER { |
|
1450 public InferenceBound complement() { return LOWER; } |
|
1451 }, |
1450 /** lower bounds */ |
1452 /** lower bounds */ |
1451 LOWER, |
1453 LOWER { |
|
1454 public InferenceBound complement() { return UPPER; } |
|
1455 }, |
1452 /** equality constraints */ |
1456 /** equality constraints */ |
1453 EQ |
1457 EQ { |
|
1458 public InferenceBound complement() { return EQ; } |
|
1459 }; |
|
1460 |
|
1461 public abstract InferenceBound complement(); |
1454 } |
1462 } |
1455 |
1463 |
1456 /** inference variable bounds */ |
1464 /** inference variable bounds */ |
1457 protected Map<InferenceBound, List<Type>> bounds; |
1465 protected Map<InferenceBound, List<Type>> bounds; |
1458 |
1466 |
1634 public void addBound(InferenceBound ib, Type bound, Types types, boolean update) { |
1642 public void addBound(InferenceBound ib, Type bound, Types types, boolean update) { |
1635 if (update) { |
1643 if (update) { |
1636 //only change bounds if request comes from substBounds |
1644 //only change bounds if request comes from substBounds |
1637 super.addBound(ib, bound, types, update); |
1645 super.addBound(ib, bound, types, update); |
1638 } |
1646 } |
|
1647 else if (bound.hasTag(UNDETVAR) && !((UndetVar) bound).isCaptured()) { |
|
1648 ((UndetVar) bound).addBound(ib.complement(), this, types, false); |
|
1649 } |
1639 } |
1650 } |
1640 |
1651 |
1641 @Override |
1652 @Override |
1642 public boolean isCaptured() { |
1653 public boolean isCaptured() { |
1643 return true; |
1654 return true; |