diff options
author | Martin Odersky <odersky@gmail.com> | 2013-02-18 09:41:11 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-02-18 09:41:11 +0100 |
commit | 2b4a19e80a643dfdf8eea5fa40811f76edb27be3 (patch) | |
tree | 564455c04aba5c2da721a188e85163e5240957c5 /src/dotty/tools/dotc/core/TypeOps.scala | |
parent | 6bd453e8f3b50e7c48b6969bd4aaf6638b0455f8 (diff) | |
download | dotty-2b4a19e80a643dfdf8eea5fa40811f76edb27be3.tar.gz dotty-2b4a19e80a643dfdf8eea5fa40811f76edb27be3.tar.bz2 dotty-2b4a19e80a643dfdf8eea5fa40811f76edb27be3.zip |
Fleshed out TypeTreeGen.
All base cases now supported. Still missing: Intelligent treatment of positions.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeOps.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala index 52f0ef23e..f3193a95f 100644 --- a/src/dotty/tools/dotc/core/TypeOps.scala +++ b/src/dotty/tools/dotc/core/TypeOps.scala @@ -130,6 +130,9 @@ trait TypeOps { this: Context => } } + final def glb(tps: List[Type]): Type = + (defn.AnyType /: tps)(glb) + def lub(tp1: Type, tp2: Type): Type = if (tp1 eq tp2) tp1 else if (tp1.isWrong) tp1 @@ -144,6 +147,9 @@ trait TypeOps { this: Context => } } + final def lub(tps: List[Type]): Type = + (defn.NothingType /: tps)(lub) + /** Merge `t1` into `tp2` if t1 is a subtype of some part of tp2. */ private def mergeIfSub(tp1: Type, tp2: Type)(implicit ctx: Context): Type = |