aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-06-03 11:33:53 +0200
committerMartin Odersky <odersky@gmail.com>2013-06-03 11:33:53 +0200
commit339809ed82e14699681a5a7765c87133cd681ec0 (patch)
tree283b653e9260d3feb01e19b955033de74bc53790 /src/dotty/tools/dotc/core/Denotations.scala
parent17d0e7008f62882c10193ea0db09c9b90736c320 (diff)
downloaddotty-339809ed82e14699681a5a7765c87133cd681ec0.tar.gz
dotty-339809ed82e14699681a5a7765c87133cd681ec0.tar.bz2
dotty-339809ed82e14699681a5a7765c87133cd681ec0.zip
More solid design of Namer with some Typer bits added.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index 97b25be00..9c89a28cf 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -197,6 +197,17 @@ object Denotations {
def requiredMethod(name: PreName)(implicit ctx: Context): TermSymbol =
info.member(name.toTermName).requiredSymbol(_ is Method).asTerm
+ /** The denotation that has a type matching `targetType` when seen
+ * as a member of type `site`, `NoDenotation` if none exists.
+ */
+ def matchingDenotation(site: Type, targetType: Type)(implicit ctx: Context): SingleDenotation =
+ if (isOverloaded)
+ atSignature(targetType.signature).matchingDenotation(site, targetType)
+ else if (exists && !(site.memberInfo(symbol) matches targetType))
+ NoDenotation
+ else
+ this.asInstanceOf[SingleDenotation]
+
/** Form a denotation by conjoining with denotation `that` */
def & (that: Denotation)(implicit ctx: Context): Denotation =
if (this eq that) this