summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-19 08:39:59 +0000
committerPaul Phillips <paulp@improving.org>2011-11-19 08:39:59 +0000
commit214c145943ac2c6bf37bd40f5e07e225350201c5 (patch)
tree9ae086954e4e855e9561bbef0b812d34c82d967c /src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
parent334872e33be8385678697f3d670c8102d38cdca7 (diff)
downloadscala-214c145943ac2c6bf37bd40f5e07e225350201c5.tar.gz
scala-214c145943ac2c6bf37bd40f5e07e225350201c5.tar.bz2
scala-214c145943ac2c6bf37bd40f5e07e225350201c5.zip
Cleanups in TypeApply creation and casting.
There's every hint that it's a requirement that a TypeApply have non-empty typeArgs, but testing for and handling the empty condition is done irregularly. Made a mkTypeApply which handles the isEmpty case (returning "fun" unchanged.) Also unified most of the variations of casts under one umbrella. Review by moors.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index 3591732c70..cf8c0c596c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -282,7 +282,7 @@ trait SyntheticMethods extends ast.TreeDSL {
def equalsClassMethod: Tree = createMethod(nme.equals_, List(AnyClass.tpe), BooleanClass.tpe) { m =>
val arg0 = methodArg(m, 0)
val thatTest = gen.mkIsInstanceOf(arg0, clazzTypeToTest(clazz), true, false)
- val thatCast = arg0 AS_ATTR clazz.tpe
+ val thatCast = gen.mkCast(arg0, clazz.tpe)
def argsBody: Tree = {
val otherName = context.unit.freshTermName(clazz.name + "$")