aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-21 14:52:04 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-11 08:24:36 +0200
commit330773619d01b9f684676ec4253b3d76c4807222 (patch)
tree3dd54e60e343744348aa28dfffc70397cf70399d /src/dotty/tools/dotc/core/SymDenotations.scala
parent3f542aabf7944cc36302753d6126bb06e571d218 (diff)
downloaddotty-330773619d01b9f684676ec4253b3d76c4807222.tar.gz
dotty-330773619d01b9f684676ec4253b3d76c4807222.tar.bz2
dotty-330773619d01b9f684676ec4253b3d76c4807222.zip
Fix to primaryConstructor
Primary constructor was picking last constructor instead of first one. This is now fixed. Also, added paramAccessors utility method.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index ed123a384..378d95b81 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -1423,9 +1423,15 @@ object SymDenotations {
override def primaryConstructor(implicit ctx: Context): Symbol = {
val cname = if (this is ImplClass) nme.IMPLCLASS_CONSTRUCTOR else nme.CONSTRUCTOR
- decls.denotsNamed(cname).first.symbol
+ decls.denotsNamed(cname).last.symbol // denotsNamed returns Symbols in reverse order of occurrence
}
+ /** The parameter accessors of this class. Term and type accessors,
+ * getters and setters are all returned int his list
+ */
+ def paramAccessors(implicit ctx: Context): List[Symbol] =
+ decls.filter(_ is ParamAccessor).toList
+
/** If this class has the same `decls` scope reference in `phase` and
* `phase.next`, install a new denotation with a cloned scope in `phase.next`.
*/