diff options
author | Martin Odersky <odersky@gmail.com> | 2013-07-08 11:05:55 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-07-11 10:07:32 +0200 |
commit | c9679f6c0f3c8200e1b1f537e89488094cfc2576 (patch) | |
tree | 59f142f2b241049737bfb71838235a4451d40cc1 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | 0af96c0f5179104fca02cf1aa144c6176bdb71eb (diff) | |
download | dotty-c9679f6c0f3c8200e1b1f537e89488094cfc2576.tar.gz dotty-c9679f6c0f3c8200e1b1f537e89488094cfc2576.tar.bz2 dotty-c9679f6c0f3c8200e1b1f537e89488094cfc2576.zip |
Added functionality to deal with function applications.
- Added Applications class to represent applications
- Added Constraint class to represent type constraints
- Added TyperState class to represent typer state
- Added Diagnostic class to buffer errors and warnings
- Added Inferencing class that contains some common functionality for type inferencing (this one's still rudimentary).
- Added extractor for FunctionType in Definitions
- Added desugaring of default parameters to default getters in Desugar
- Added flags to deal with default parameters
- Added substitutions that replace bound parameters
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 87fc33a6c..cb010ed8e 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -449,6 +449,7 @@ object Denotations { * is still a member of its enclosing package, then the whole flock * is brought forward to be valid in the new runId. Otherwise * the symbol is stale, which constitutes an internal error. + * TODO: Ensure that a subclass is renewed whenever one of its parents is. */ def current(implicit ctx: Context): SingleDenotation = { val currentPeriod = ctx.period @@ -529,6 +530,8 @@ object Denotations { final def toDenot(pre: Type)(implicit ctx: Context) = this final def containsSig(sig: Signature)(implicit ctx: Context) = exists && signature == sig + final def filterWithPredicate(p: SingleDenotation => Boolean): PreDenotation = + if (p(this)) this else NoDenotation final def filterDisjoint(denots: PreDenotation)(implicit ctx: Context): SingleDenotation = if (denots.containsSig(signature)) NoDenotation else this def disjointAsSeenFrom(denots: PreDenotation, pre: Type)(implicit ctx: Context): SingleDenotation = @@ -598,6 +601,8 @@ object Denotations { /** Group contains a denotation with given signature */ def containsSig(sig: Signature)(implicit ctx: Context): Boolean + def filterWithPredicate(p: SingleDenotation => Boolean): PreDenotation + /** Keep only those denotations in this group which have a signature * that's not already defined by `denots`. */ @@ -627,6 +632,8 @@ object Denotations { def toDenot(pre: Type)(implicit ctx: Context) = (denots1 toDenot pre) & (denots2 toDenot pre, pre) def containsSig(sig: Signature)(implicit ctx: Context) = (denots1 containsSig sig) || (denots2 containsSig sig) + def filterWithPredicate(p: SingleDenotation => Boolean): PreDenotation = + derivedUnion(denots1 filterWithPredicate p, denots2 filterWithPredicate p) def filterDisjoint(denots: PreDenotation)(implicit ctx: Context): PreDenotation = derivedUnion(denots1 filterDisjoint denots, denots2 filterDisjoint denots) def disjointAsSeenFrom(denots: PreDenotation, pre: Type)(implicit ctx: Context): PreDenotation = |