Load source or class file for root
from Scala pickles.
Load source or class file for root
from Scala pickles.
This method fills in sym
with the information from the Scala
pickle. The whole mechanism takes a pickle file (which is under
the hood hidden as a class file so that the scala classpath
mechanism finds it), a class and a module symbol (representing
the corresponding class and module symbol related to sym
) and
the symbol sym
which is the one under completion.
The logic here is simple: we load the pickle information from
the pickle file. If we're completing a module (because a companion
class doesn't exist), we get the information from the pickle
associated with the module class (which ends in $
, assuming
that we did the right thing in PicklerGen
and created it).
As you see, for this logic to work correctly, there always need to be a class file for the class and its companion. When there is no class associated with a module class, we still need the pickle information as if it existed because scalac requires it in some cases).