diff options
author | liu fengyun <liu@fengy.me> | 2017-04-13 14:23:47 +0200 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2017-04-13 14:24:51 +0200 |
commit | 15e8d83a377398c9c13a5319a23645d10b14579a (patch) | |
tree | f2af3a4e6aaae1a502e459eab18838c8b77817f0 /compiler/src/dotty/tools/dotc/transform/patmat/Space.scala | |
parent | d541452940007bbc094e8a7f6785b6f8e9e7da22 (diff) | |
download | dotty-15e8d83a377398c9c13a5319a23645d10b14579a.tar.gz dotty-15e8d83a377398c9c13a5319a23645d10b14579a.tar.bz2 dotty-15e8d83a377398c9c13a5319a23645d10b14579a.zip |
fix #2254: dealias types in decomposition of spaces
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/patmat/Space.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/patmat/Space.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index baf1ae356..229545a57 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -324,7 +324,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic { debug.println(s"candidates for ${tp.show} : [${children.map(_.show).mkString(", ")}]") - tp match { + tp.dealias match { case OrType(tp1, tp2) => List(Typ(tp1, true), Typ(tp2, true)) case _ if tp =:= ctx.definitions.BooleanType => List( @@ -379,7 +379,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic { def canDecompose(tp: Type): Boolean = { val res = tp.classSymbol.is(allOf(Abstract, Sealed)) || tp.classSymbol.is(allOf(Trait, Sealed)) || - tp.isInstanceOf[OrType] || + tp.dealias.isInstanceOf[OrType] || tp =:= ctx.definitions.BooleanType || tp.classSymbol.is(allOf(Enum, Sealed)) // Enum value doesn't have Sealed flag |