diff options
author | Martin Odersky <odersky@gmail.com> | 2013-09-06 22:15:47 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-09-06 22:15:47 +0200 |
commit | 2aa0615594744a7fd92f5f4d017b47e5c42a793a (patch) | |
tree | 90e4458cf2cbfdc03152588eebacb031513197ac /src/dotty/tools/dotc/core/Scopes.scala | |
parent | f7ab848229e8b9b0de1b719725816209aa1271c8 (diff) | |
download | dotty-2aa0615594744a7fd92f5f4d017b47e5c42a793a.tar.gz dotty-2aa0615594744a7fd92f5f4d017b47e5c42a793a.tar.bz2 dotty-2aa0615594744a7fd92f5f4d017b47e5c42a793a.zip |
Improvements in implicits error reporting
Plus a few bugfixes for implicits
Diffstat (limited to 'src/dotty/tools/dotc/core/Scopes.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Scopes.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Scopes.scala b/src/dotty/tools/dotc/core/Scopes.scala index 3748801b9..a308adf79 100644 --- a/src/dotty/tools/dotc/core/Scopes.scala +++ b/src/dotty/tools/dotc/core/Scopes.scala @@ -7,7 +7,7 @@ package dotty.tools.dotc package core import Symbols._ -import Types.{TermRef, NoPrefix} +import Types.{TermRef, TermRefBySym, NoPrefix} import Flags.Implicit import Names._ import Periods._ @@ -17,6 +17,7 @@ import Denotations._ import printing.Texts._ import printing.Printer import SymDenotations.NoDenotation +import collection.mutable.ListBuffer object Scopes { @@ -111,7 +112,7 @@ object Scopes { syms } - def implicitDecls(implicit ctx: Context): Set[TermRef] = Set() + def implicitDecls(implicit ctx: Context): List[TermRefBySym] = Nil final def toText(printer: Printer): Text = printer.toText(this) } @@ -287,15 +288,15 @@ object Scopes { elemsCache } - override def implicitDecls(implicit ctx: Context): Set[TermRef] = { - var irefs: Set[TermRef] = Set() + override def implicitDecls(implicit ctx: Context): List[TermRefBySym] = { + var irefs = new ListBuffer[TermRefBySym] var e = lastEntry while (e ne null) { if (e.sym is Implicit) - irefs += TermRef(NoPrefix, e.sym.name.asTermName).withDenot(e.sym.denot) + irefs += TermRef.withSym(NoPrefix, e.sym.asTerm).withDenot(e.sym.denot) e = e.prev } - irefs + irefs.toList } /** Vanilla scope - symbols are stored in declaration order. |