Skip to content

Commit ddec688

Browse files
committed
Fix memory leak
The lazy val `dummyTree` acquires a type because of copy-on-write and that type can refer via lastDenotation to a context base.
1 parent 30bd586 commit ddec688

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ object ProtoTypes {
477477
def apply(tp: Type) = wildApprox(tp, this)
478478
}
479479

480-
@sharable private lazy val dummyTree = untpd.Literal(Constant(null))
480+
@sharable private def dummyTree = untpd.Literal(Constant(null))
481481

482482
/** Dummy tree to be used as an argument of a FunProto or ViewProto type */
483483
object dummyTreeOfType {

0 commit comments

Comments
 (0)