Skip to content

Commit 044d29d

Browse files
committed
Don't compute implicit scopes for synthetic Lambda traits
1 parent 8d0312f commit 044d29d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,13 @@ trait ImplicitRunInfo { self: RunInfo =>
284284
override implicit protected val ctx: Context = liftingCtx
285285
override def stopAtStatic = true
286286
def apply(tp: Type) = tp match {
287+
case tp: TypeRef if tp.symbol.isLambdaTrait =>
288+
defn.AnyType
287289
case tp: TypeRef if tp.symbol.isAbstractOrAliasType =>
288290
val pre = tp.prefix
289291
def joinClass(tp: Type, cls: ClassSymbol) =
290-
AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner))
292+
if (cls.isLambdaTrait) tp
293+
else AndType.make(tp, cls.typeRef.asSeenFrom(pre, cls.owner))
291294
val lead = if (tp.prefix eq NoPrefix) defn.AnyType else apply(tp.prefix)
292295
(lead /: tp.classSymbols)(joinClass)
293296
case tp: TypeVar =>

0 commit comments

Comments
 (0)