diff options
author | Martin Odersky <odersky@gmail.com> | 2013-06-03 11:33:53 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-06-03 11:33:53 +0200 |
commit | 339809ed82e14699681a5a7765c87133cd681ec0 (patch) | |
tree | 283b653e9260d3feb01e19b955033de74bc53790 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | 17d0e7008f62882c10193ea0db09c9b90736c320 (diff) | |
download | dotty-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.scala | 11 |
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 |