Skip to content

make language imports available after Typer #14346

Closed
@olhotak

Description

@olhotak

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.

  1. Modify FirstTransform to keep language imports.
  2. In MegaPhase, clone and modify mapInline (called from transformStats) so that it can pass a context to the op. When this new mapInline sees an import, it should create importContext to pass to later stats. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions