diff options
author | Martin Odersky <odersky@gmail.com> | 2013-07-19 16:11:10 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-07-19 17:02:03 +0200 |
commit | ea640a32264cb78efbf267d5c2be89e3e99dcccf (patch) | |
tree | e4c3103d9d08580d9ef478763fb52c80548feef8 /src/dotty/tools/dotc/core/Scopes.scala | |
parent | 17ef71dc2b11c5d1a82307f79d50c7ed0f77fd81 (diff) | |
download | dotty-ea640a32264cb78efbf267d5c2be89e3e99dcccf.tar.gz dotty-ea640a32264cb78efbf267d5c2be89e3e99dcccf.tar.bz2 dotty-ea640a32264cb78efbf267d5c2be89e3e99dcccf.zip |
Additions needed to support implicits.
Still to do:
- properly account for bounded wildcard types
- set up scheme for nested diagnostics buffers.
Diffstat (limited to 'src/dotty/tools/dotc/core/Scopes.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Scopes.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Scopes.scala b/src/dotty/tools/dotc/core/Scopes.scala index 82ec0a30a..b622af6ac 100644 --- a/src/dotty/tools/dotc/core/Scopes.scala +++ b/src/dotty/tools/dotc/core/Scopes.scala @@ -7,6 +7,8 @@ package dotty.tools.dotc package core import Symbols._ +import Types.{TermRef, NoPrefix} +import Flags.Implicit import Names._ import Periods._ import Decorators._ @@ -109,6 +111,8 @@ object Scopes { syms } + def implicitDecls(implicit ctx: Context): Set[TermRef] = Set() + final def toText(printer: Printer): Text = printer.toText(this) } @@ -283,6 +287,17 @@ object Scopes { elemsCache } + override def implicitDecls(implicit ctx: Context): Set[TermRef] = { + var irefs: Set[TermRef] = Set() + var e = lastEntry + while (e ne null) { + if (e.sym is Implicit) + irefs += TermRef(NoPrefix, e.sym.name.asTermName).withDenot(e.sym.denot) + e = e.prev + } + irefs + } + /** Vanilla scope - symbols are stored in declaration order. */ final def sorted: List[Symbol] = toList |