aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Petrashko <dark@d-d.me>2015-10-23 10:31:11 +0200
committerDmitry Petrashko <dark@d-d.me>2015-10-23 10:31:11 +0200
commit50fe6eb3f1edbbecd4c5f750ac61a9396c3f3852 (patch)
tree1f712daf3fc91f22488ae7ffb7e397b892fe3ec2 /src
parent56f9ab865d51d11c8ab45424233543ac2d775c93 (diff)
parentf786ce5903670c7496e8a295ec1a49a6e512c896 (diff)
downloaddotty-50fe6eb3f1edbbecd4c5f750ac61a9396c3f3852.tar.gz
dotty-50fe6eb3f1edbbecd4c5f750ac61a9396c3f3852.tar.bz2
dotty-50fe6eb3f1edbbecd4c5f750ac61a9396c3f3852.zip
Merge pull request #849 from dotty-staging/fix-#840
Fix #840
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/transform/Erasure.scala2
-rw-r--r--src/dotty/tools/dotc/transform/TypeTestsCasts.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala
index b1c896997..a414c6399 100644
--- a/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/src/dotty/tools/dotc/transform/Erasure.scala
@@ -400,7 +400,7 @@ object Erasure extends TypeTestsCasts{
}
override def typedTypeApply(tree: untpd.TypeApply, pt: Type)(implicit ctx: Context) = {
- val ntree = interceptTypeApply(tree.asInstanceOf[TypeApply])
+ val ntree = interceptTypeApply(tree.asInstanceOf[TypeApply])(ctx.withPhase(ctx.erasurePhase))
ntree match {
case TypeApply(fun, args) =>
diff --git a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala
index 4ce64da33..98b8357b9 100644
--- a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala
+++ b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala
@@ -47,7 +47,7 @@ trait TypeTestsCasts {
def transformIsInstanceOf(expr:Tree, argType: Type): Tree = {
def argCls = argType.classSymbol
- if (expr.tpe <:< argType)
+ if ((expr.tpe <:< argType) && isPureExpr(expr))
Literal(Constant(true)) withPos tree.pos
else if (argCls.isPrimitiveValueClass)
if (qualCls.isPrimitiveValueClass) Literal(Constant(qualCls == argCls)) withPos tree.pos