We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 221320f commit 49fd9bdCopy full SHA for 49fd9bd
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2157,13 +2157,15 @@ object Types {
2157
}
2158
2159
case class LazyRef(refFn: () => Type) extends UncachedProxyType with ValueType {
2160
+ private var myRefFn: () => Type = refFn
2161
private var myRef: Type = null
2162
private var computed = false
2163
def ref = {
2164
if (computed) assert(myRef != null)
2165
else {
2166
computed = true
- myRef = refFn()
2167
+ myRef = myRefFn()
2168
+ myRefFn = null // null out to avoid memory leak
2169
2170
myRef
2171
0 commit comments