diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-06 20:24:19 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-06 20:24:19 +0100 |
commit | 71027f15cc9e125520c210d01a1b453f6ba45ec0 (patch) | |
tree | 512de7655053b09ee28db099cf70d10570683829 | |
parent | 2948c91f06eacc1c1904576275b31d2872702917 (diff) | |
download | dotty-71027f15cc9e125520c210d01a1b453f6ba45ec0.tar.gz dotty-71027f15cc9e125520c210d01a1b453f6ba45ec0.tar.bz2 dotty-71027f15cc9e125520c210d01a1b453f6ba45ec0.zip |
Fix divergence test for implicits
The test did not fire if the set of class symbols of the searched-for type was empty.
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index 2e8598c64..789f1edda 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -502,7 +502,9 @@ class SearchHistory(val searchDepth: Int, val seen: Map[ClassSymbol, Int]) { case Some(prevSize) if size >= prevSize => this case _ => updateMap(csyms1, seen.updated(csym, size)) } - case _ => new SearchHistory(searchDepth + 1, seen) + case nil => + if (csyms.isEmpty) this + else new SearchHistory(searchDepth + 1, seen) } updateMap(proto.classSymbols, seen) } |