diff options
author | Martin Odersky <odersky@gmail.com> | 2013-10-02 14:03:45 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-10-02 14:03:45 +0200 |
commit | fda5cdccad52657191e756ad2d47595a9c25b0ff (patch) | |
tree | a1c385a93b50097c7645aca8666d7bfd4b69a014 /src/dotty/tools/dotc/core/TypeComparer.scala | |
parent | f039fa7fa2544998426764bd05ea8f18179eb0bd (diff) | |
download | dotty-fda5cdccad52657191e756ad2d47595a9c25b0ff.tar.gz dotty-fda5cdccad52657191e756ad2d47595a9c25b0ff.tar.bz2 dotty-fda5cdccad52657191e756ad2d47595a9c25b0ff.zip |
Introducing mapReduce for OrTypes and AndTypes
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeComparer.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index 697526c23..14b0413ec 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -520,7 +520,7 @@ class TypeComparer(initctx: Context) extends DotClass { * Such TypeBounds can also be arbitrarily instantiated. In both cases we need to * make sure that such types do not actually arise in source programs. */ - final def andType(tp1: Type, tp2: Type) = { + final def andType(tp1: Type, tp2: Type) = ctx.traceIndented(s"glb(${tp1.show}, ${tp2.show})", show = true) { val t1 = distributeAnd(tp1, tp2) if (t1.exists) t1 else { @@ -729,7 +729,13 @@ class TypeComparer(initctx: Context) extends DotClass { case _ => false } +/* + def widenInferred(tp: Type) = tp match { + case tp: OrType => + val alts = tp.mapReduceOr(_ :: Nil)(_ ::: _) + } +*/ def copyIn(ctx: Context) = new TypeComparer(ctx) } |