diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-19 12:30:06 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-19 12:30:06 +0100 |
commit | c0ce16a03645056016636d7cda514daed2b7ab70 (patch) | |
tree | cf7f16eef908e5ff4b4cf5820073565227e3b6d3 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 6be96724899f9c34db2e6c2617534dc9c4a15528 (diff) | |
download | dotty-c0ce16a03645056016636d7cda514daed2b7ab70.tar.gz dotty-c0ce16a03645056016636d7cda514daed2b7ab70.tar.bz2 dotty-c0ce16a03645056016636d7cda514daed2b7ab70.zip |
3 changes to implicit search
1. Shadowing tree uses adaptation funProto of prototype. Previously many shadowing tries failed with errors like "need to follow with "_" to adapt to function". These early failures hid potential shadowing conflicts.
2. Shadowing conflict testing is now done using symbols instead of comparing references. Comparing references gave false negative when a shadoing tree had inferred type parameters, for instance. There were other problems as well. Generally, comparsing references seems too fragile.
3. Inferred views are now re-adapted. This is necessary if the view itself takes another implicit parameter.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 7493fb42d..cf7d54ca6 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1113,8 +1113,8 @@ class Typer extends Namer with Applications with Implicits { } // try an implicit conversion inferView(tree, pt) match { - case SearchSuccess(adapted, _, _) => - adapted + case SearchSuccess(inferred, _, _) => + adapt(inferred, pt) case failure: SearchFailure => if (pt.isInstanceOf[ProtoType]) tree else err.typeMismatch(tree, pt, failure) |