File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class CheckLoopingImplicits extends MiniPhase:
7171 case SeqLiteral (elems, _) =>
7272 elems.foreach(checkNotLooping)
7373 case t : ValDef =>
74- checkNotLooping(t.rhs)
74+ if ! t.symbol.is( Lazy ) then checkNotLooping(t.rhs)
7575 case _ =>
7676
7777 if sym.isOneOf(GivenOrImplicit ) then
Original file line number Diff line number Diff line change @@ -32,5 +32,19 @@ val x4 =
3232 repIdentity(bar.toFoo) // error
3333 val foo : Foo = Bar (1 )
3434
35+ val x5 =
36+ implicit def barToFoo4 (bar : Bar ): Foo =
37+ val y = bar.toFoo // error
38+ y
39+ val foo : Foo = Bar (1 )
40+
41+ val x6 =
42+ implicit def barToFoo4 (bar : Bar ): Foo =
43+ lazy val y = bar.toFoo // OK
44+ if false then y else ???
45+ val foo : Foo = Bar (1 )
46+
47+
48+
3549
3650
You can’t perform that action at this time.
0 commit comments