Closed
Description
In #14319 and #13976, we need a way to know whether we are in unsafe nulls mode in later phases after Typer. I discussed with @odersky and we came up with a general approach to make language imports available in later phases.
- Modify
FirstTransform
to keep language imports. - In
MegaPhase
, clone and modifymapInline
(called fromtransformStats
) so that it can pass a context to theop
. When this newmapInline
sees an import, it should createimportContext
to pass to laterstats
.mapInline
is performance sensitive so this has to be done carefully.
If we do the above in general, for the specific case of unsafe nulls, the existing handling in setImportInfo
will automatically set the Mode.SafeNulls
flag accordingly.