aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-10-11 21:24:57 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-12 10:48:03 +0200
commitf244287fdba4ccf64e2404285b713cee599448ba (patch)
tree125f864b1cca5cfed1612eda2b182dc6b81ea6c3 /src/dotty/tools/dotc/core/SymDenotations.scala
parent33113aa693c7290eda504029b14f7fcb8e104391 (diff)
downloaddotty-f244287fdba4ccf64e2404285b713cee599448ba.tar.gz
dotty-f244287fdba4ccf64e2404285b713cee599448ba.tar.bz2
dotty-f244287fdba4ccf64e2404285b713cee599448ba.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.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index cea9be604..4d0513abf 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -200,7 +200,7 @@ object SymDenotations {
final def hasAnnotation(cls: Symbol)(implicit ctx: Context) =
dropOtherAnnotations(annotations, cls).nonEmpty
- /** Optionally, get annotation matching the given class symbol */
+ /** Optionally, the annotation matching the given class symbol */
final def getAnnotation(cls: Symbol)(implicit ctx: Context): Option[Annotation] =
dropOtherAnnotations(annotations, cls) match {
case annot :: _ => Some(annot)
@@ -431,7 +431,7 @@ object SymDenotations {
/** Does this symbol denote the primary constructor of its enclosing class? */
final def isPrimaryConstructor(implicit ctx: Context) =
- isConstructor && owner.primaryConstructor.denot == this
+ isConstructor && owner.primaryConstructor == symbol
/** Is this a subclass of the given class `base`? */
def isSubClass(base: Symbol)(implicit ctx: Context) = false