Skip to content

Commit 353d964

Browse files
committed
Remove unnecessary cacheResult=false, add test case.
1 parent 0f9a672 commit 353d964

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ object Semantic:
893893

894894
case Cold => Cold
895895

896-
case ref: Ref => eval(vdef.rhs, ref, enclosingClass, cacheResult = true)
896+
case ref: Ref => eval(vdef.rhs, ref, enclosingClass)
897897

898898
case _ =>
899899
report.error("[Internal error] unexpected this value when accessing local variable, sym = " + sym.show + ", thisValue = " + thisValue2.show + Trace.show, Trace.position)

tests/init/pos/recursion.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class A {
2+
3+
val f: Int => Int = {
4+
x => f(x)
5+
}
6+
7+
f(5)
8+
9+
}

0 commit comments

Comments
 (0)