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 f1cd684 commit df57c0bCopy full SHA for df57c0b
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2146,13 +2146,15 @@ object Types {
2146
}
2147
2148
case class LazyRef(refFn: () => Type) extends UncachedProxyType with ValueType {
2149
+ private var myRefFn: () => Type = refFn
2150
private var myRef: Type = null
2151
private var computed = false
2152
def ref = {
2153
if (computed) assert(myRef != null)
2154
else {
2155
computed = true
- myRef = refFn()
2156
+ myRef = myRefFn()
2157
+ myRefFn = null // null out to avoid memory leak
2158
2159
myRef
2160
0 commit comments