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 49fd9bd commit 2f6cb08Copy full SHA for 2f6cb08
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2156,16 +2156,14 @@ object Types {
2156
}
2157
2158
2159
- case class LazyRef(refFn: () => Type) extends UncachedProxyType with ValueType {
2160
- private var myRefFn: () => Type = refFn
+ case class LazyRef(private var refFn: () => Type) extends UncachedProxyType with ValueType {
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
2167
- myRef = myRefFn()
2168
- myRefFn = null // null out to avoid memory leak
+ myRef = refFn()
2169
2170
myRef
2171
0 commit comments