- Notifications
You must be signed in to change notification settings - Fork 1.1k
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
FirstTransformto keep language imports. - In
MegaPhase, clone and modifymapInline(called fromtransformStats) so that it can pass a context to theop. When this newmapInlinesees an import, it should createimportContextto pass to laterstats.mapInlineis 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.