diff options
author | Martin Odersky <odersky@gmail.com> | 2015-01-23 01:04:00 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-01-23 01:04:00 +0100 |
commit | fd3a5beb5176581c07badaaa15beb88dc06752ed (patch) | |
tree | c2412dcddcf1e16b5a99ace25d18682bd3964a21 /src/dotty/tools/dotc/core/Constraint.scala | |
parent | b45c69fb992acf1bbd9511408193d6d92ef7089a (diff) | |
download | dotty-fd3a5beb5176581c07badaaa15beb88dc06752ed.tar.gz dotty-fd3a5beb5176581c07badaaa15beb88dc06752ed.tar.bz2 dotty-fd3a5beb5176581c07badaaa15beb88dc06752ed.zip |
New constraint method: narrowBound
Allows to merge the functionality of addOneLowerBound and addOneUpperBound in
ConstraintHandling.
Diffstat (limited to 'src/dotty/tools/dotc/core/Constraint.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Constraint.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Constraint.scala b/src/dotty/tools/dotc/core/Constraint.scala index 10e6d0d5a..873a3c913 100644 --- a/src/dotty/tools/dotc/core/Constraint.scala +++ b/src/dotty/tools/dotc/core/Constraint.scala @@ -106,6 +106,12 @@ abstract class Constraint extends Showable { * of the parameter elsewhere in the constraint by type `tp`. */ def replace(param: PolyParam, tp: Type)(implicit ctx: Context): This + + /** Narrow one of the bounds of type parameter `param` + * If `isUpper` is true, ensure that `param <: `bound`, otherwise ensure + * that `param >: bound`. + */ + def narrowBound(param: PolyParam, bound: Type, isUpper: Boolean)(implicit ctx: Context): This /** Is entry associated with `pt` removable? * @param removedParam The index of a parameter which is still present in the |