From 044d29dd6b133bfb28468366ee92046b77adf6f9 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 31 May 2016 15:43:01 +0200 Subject: Don't compute implicit scopes for synthetic Lambda traits --- src/dotty/tools/dotc/typer/Implicits.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc') diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index b59d177b1..7de40294d 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -284,10 +284,13 @@ trait ImplicitRunInfo { self: RunInfo => override implicit protected val ctx: Context = liftingCtx override def stopAtStatic = true def apply(tp: Type) = tp match { + case tp: TypeRef if tp.symbol.isLambdaTrait => + defn.AnyType case tp: TypeRef if tp.symbol.isAbstractOrAliasType => val pre = tp.prefix def joinClass(tp: Type, cls: ClassSymbol) = - AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner)) + if (cls.isLambdaTrait) tp + else AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner)) val lead = if (tp.prefix eq NoPrefix) defn.AnyType else apply(tp.prefix) (lead /: tp.classSymbols)(joinClass) case tp: TypeVar => -- cgit v1.2.3