summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/TreeGen.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-09-27 00:32:40 -0700
committerPaul Phillips <paulp@improving.org>2013-09-27 00:34:13 -0700
commit693ecffbaf5be036e05300a1ee3a8444c0ac0fe3 (patch)
tree1032802cd3e29e7bb9c8cd2abad8dcb0a0b3ed8f /src/reflect/scala/reflect/internal/TreeGen.scala
parent0aaf59149871f817a67c1fefcc3b0457fcb5e4fc (diff)
downloadscala-693ecffbaf5be036e05300a1ee3a8444c0ac0fe3.tar.gz
scala-693ecffbaf5be036e05300a1ee3a8444c0ac0fe3.tar.bz2
scala-693ecffbaf5be036e05300a1ee3a8444c0ac0fe3.zip
Fix up DEFAULTPARAM semantics.
I foolishly believed the deprecation message on "hasDefaultFlag" which suggested I use "hasDefault" instead. After lots of head scratching, I hardened the semantics so it's like this: - A method parameter with a default value is PARAM | DEFAULTPARAM - A default getter for such a parameter is METHOD | DEFAULTPARAM - And "hasDefault" is has(DEFAULTPARAM) && has(PARAM | METHOD) Why all the bonus logic, why not just hasFlag(DEFAULTPARAM)? For some reason we have a handful of overloaded flags spanning uses which someone apparently thinks can never intersect but I have not been so lucky overall. So since DEFAULTPARAM is overloaded with TRAIT, unless we think it's fine that default getters and method parameters with defaults will pose as traits all the time, there has to be an anchor bit alongside it.
Diffstat (limited to 'src/reflect/scala/reflect/internal/TreeGen.scala')
-rw-r--r--src/reflect/scala/reflect/internal/TreeGen.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala
index c8ae4df13d..9be1768289 100644
--- a/src/reflect/scala/reflect/internal/TreeGen.scala
+++ b/src/reflect/scala/reflect/internal/TreeGen.scala
@@ -376,7 +376,7 @@ abstract class TreeGen extends macros.TreeBuilder {
DefDef(constrMods, nme.CONSTRUCTOR, List(), vparamss1, TypeTree(), Block(lvdefs ::: List(superCall), Literal(Constant())))))
}
}
- constr foreach (ensureNonOverlapping(_, parents ::: gvdefs, focus=false))
+ constr foreach (ensureNonOverlapping(_, parents ::: gvdefs, focus = false))
// Field definitions for the class - remove defaults.
val fieldDefs = vparamss.flatten map (vd => copyValDef(vd)(mods = vd.mods &~ DEFAULTPARAM, rhs = EmptyTree))