ReusableInstance

dotty.tools.dotc.util.ReusableInstance
See theReusableInstance companion object
final class ReusableInstance[T <: AnyRef]

A wrapper for a list of cached instances of a type T. The wrapper is recursion-reentrant: several instances are kept, so at each depth of reentrance we are reusing the instance for that.

An instance is created upon creating this object, and more instances are allocated dynamically, on demand, when reentrance occurs.

Not thread safe.

Ported from scala.reflect.internal.util.ReusableInstance

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

inline def withInstance[R](action: T => R): R