From 0efa171e8ccca0d49fc6d800fd21e29f7b7336fd Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sat, 11 Jul 2015 01:35:54 +0200 Subject: Don't add lower bounds of abstract types to the implicit scope As the spec[1] says: "The parts of a type T are [...] if T is an abstract type, the parts of its upper bound;" [1]: http://www.scala-lang.org/files/archive/spec/2.11/07-implicits.html#implicit-parameters --- src/dotty/tools/dotc/core/Types.scala | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/dotty') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 61ab1133b..4d6a7e22b 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -3118,6 +3118,8 @@ object Types { apply(foldOver(maybeAdd(x, tp), tp), tp.underlying) case tp: TypeRef => foldOver(maybeAdd(x, tp), tp) + case TypeBounds(_, hi) => + apply(x, hi) case tp: ThisType => apply(x, tp.underlying) case tp: ConstantType => -- cgit v1.2.3