Handle weak reference that can be reset by the GC
Handle weak reference that can be reset by the GC

owningState weak reference can be reset to null. This was observed
when compiling scalatest.

lampepfl/dotty,sjrd/dotty,dotty-staging/dotty,sjrd/dotty,dotty-staging/dotty,sjrd/dotty,dotty-staging/dotty,lampepfl/dotty,lampepfl/dotty,lampepfl/dotty,lampepfl/dotty,sjrd/dotty,dotty-staging/dotty,sjrd/dotty,dotty-staging/dotty