Skip to content

Commit 2d4efa0

Browse files
committed
Reflect nesting of lazy_implicit values in their levels
This caused nested ambiguity errors with the next commit.
1 parent fd70c61 commit 2d4efa0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import TypeErasure.{erasure, hasStableErasure}
1515
import Mode.ImplicitsEnabled
1616
import Denotations._
1717
import NameOps._
18+
import NameKinds.LazyImplicitName
1819
import SymDenotations._
1920
import Symbols._
2021
import Types._
@@ -185,7 +186,8 @@ object Implicits {
185186
if (outerImplicits == null) 1
186187
else if (ctx.scala2Mode ||
187188
(ctx.owner eq outerImplicits.ctx.owner) &&
188-
(ctx.scope eq outerImplicits.ctx.scope)) outerImplicits.level
189+
(ctx.scope eq outerImplicits.ctx.scope) &&
190+
!refs.head.name.is(LazyImplicitName)) outerImplicits.level
189191
else outerImplicits.level + 1
190192

191193
/** Is this the outermost implicits? This is the case if it either the implicits

0 commit comments

Comments
 (0)