aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/CheckTrees.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-18 19:04:33 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-18 19:05:27 +0100
commitb6d7b28403c34f61c5317c37acce1b4118a4181c (patch)
treebbfee77f416b2746c37f13fd541d7b30905a4bf0 /src/dotty/tools/dotc/ast/CheckTrees.scala
parentf046e7a0c26500850a51e2f60122631b2c807f65 (diff)
downloaddotty-b6d7b28403c34f61c5317c37acce1b4118a4181c.tar.gz
dotty-b6d7b28403c34f61c5317c37acce1b4118a4181c.tar.bz2
dotty-b6d7b28403c34f61c5317c37acce1b4118a4181c.zip
Various cleanups
Diffstat (limited to 'src/dotty/tools/dotc/ast/CheckTrees.scala')
-rw-r--r--src/dotty/tools/dotc/ast/CheckTrees.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/ast/CheckTrees.scala b/src/dotty/tools/dotc/ast/CheckTrees.scala
index cce68c557..4d8e25ae3 100644
--- a/src/dotty/tools/dotc/ast/CheckTrees.scala
+++ b/src/dotty/tools/dotc/ast/CheckTrees.scala
@@ -105,7 +105,7 @@ object CheckTrees {
check(escapingRefs(tree).isEmpty)
case If(cond, thenp, elsep) =>
check(cond.isValue); check(thenp.isValue); check(elsep.isValue)
- check(cond.tpe.derivesFrom(defn.BooleanClass))
+ check(cond.tpe isRef defn.BooleanClass)
case Closure(env, meth, target) =>
meth.tpe.widen match {
case mt @ MethodType(_, paramTypes) =>
@@ -195,7 +195,7 @@ object CheckTrees {
}
case Alternative(alts) =>
for (alt <- alts) check(alt.isValueOrPattern)
- case UnApply(fun, args) =>
+ case UnApply(fun, args) => // todo: review
check(fun.isTerm)
for (arg <- args) check(arg.isValueOrPattern)
val funtpe @ MethodType(_, _) = fun.tpe.widen
@@ -206,17 +206,16 @@ object CheckTrees {
check(args.head.isInstanceOf[SeqLiteral])
case nme.unapply =>
val rtp = funtpe.resultType
- val rsym = rtp.dealiasedTypeSymbol
- if (rsym == defn.BooleanClass)
+ if (rtp isRef defn.BooleanClass)
check(args.isEmpty)
else {
- check(rsym == defn.OptionClass)
+ check(rtp isRef defn.OptionClass)
val normArgs = rtp.typeArgs match {
case optionArg :: Nil =>
optionArg.typeArgs match {
case Nil =>
optionArg :: Nil
- case tupleArgs if defn.TupleClasses contains optionArg.dealiasedTypeSymbol =>
+ case tupleArgs if defn.isTupleType(optionArg) =>
tupleArgs
}
case _ =>