diff options
author | Martin Odersky <odersky@gmail.com> | 2014-09-21 14:52:04 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-10-11 08:24:36 +0200 |
commit | 330773619d01b9f684676ec4253b3d76c4807222 (patch) | |
tree | 3dd54e60e343744348aa28dfffc70397cf70399d /src/dotty/tools/dotc/core/Denotations.scala | |
parent | 3f542aabf7944cc36302753d6126bb06e571d218 (diff) | |
download | dotty-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/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 09b67d08a..82fd60fa0 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -681,6 +681,7 @@ object Denotations { // ------ PreDenotation ops ---------------------------------------------- final def first = this + final def last = this final def toDenot(pre: Type)(implicit ctx: Context): Denotation = this final def containsSym(sym: Symbol): Boolean = hasUniqueSym && (symbol eq sym) final def containsSig(sig: Signature)(implicit ctx: Context) = @@ -766,8 +767,9 @@ object Denotations { /** A denotation in the group exists */ def exists: Boolean - /** First denotation in the group */ + /** First/last denotation in the group */ def first: Denotation + def last: Denotation /** Convert to full denotation by &-ing all elements */ def toDenot(pre: Type)(implicit ctx: Context): Denotation @@ -832,6 +834,7 @@ object Denotations { assert(denots1.exists && denots2.exists, s"Union of non-existing denotations ($denots1) and ($denots2)") def exists = true def first = denots1.first + def last = denots2.last def toDenot(pre: Type)(implicit ctx: Context) = (denots1 toDenot pre) & (denots2 toDenot pre, pre) def containsSym(sym: Symbol) = |