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:
71
71
case SeqLiteral (elems, _) =>
72
72
elems.foreach(checkNotLooping)
73
73
case t : ValDef =>
74
- checkNotLooping(t.rhs)
74
+ if ! t.symbol.is( Lazy ) then checkNotLooping(t.rhs)
75
75
case _ =>
76
76
77
77
if sym.isOneOf(GivenOrImplicit ) then
Original file line number Diff line number Diff line change @@ -32,5 +32,19 @@ val x4 =
32
32
repIdentity(bar.toFoo) // error
33
33
val foo : Foo = Bar (1 )
34
34
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
+
35
49
36
50
You can’t perform that action at this time.
0 commit comments