-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make language imports available after Typer #14346
Comments
anatoliykmetyuk
added
the
stat:needs triage
Every issue needs to have an "area" and "itype" label
label
Jan 25, 2022
olhotak
added
area:infrastructure
area:nullability
itype:enhancement
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
area:infrastructure
labels
Jan 25, 2022
I can take care of this. |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 26, 2022
Some phases might need to know what language imports are active. Concretely, uner explicit nulls, the exhaustivity checks for patterns need to know that. We therefore keep language imports until phase PruneErasedDefs. Other imports are dropped in FirstTransform, as before. The handling of statements in MegaPhase was changed so that imports now are visible in the context for transforming the following statements. Fixes scala#14346
Xavientois
pushed a commit
to Xavientois/dotty
that referenced
this issue
Feb 2, 2022
Some phases might need to know what language imports are active. Concretely, uner explicit nulls, the exhaustivity checks for patterns need to know that. We therefore keep language imports until phase PruneErasedDefs. Other imports are dropped in FirstTransform, as before. The handling of statements in MegaPhase was changed so that imports now are visible in the context for transforming the following statements. Fixes scala#14346
olsdavis
pushed a commit
to olsdavis/dotty
that referenced
this issue
Apr 4, 2022
Some phases might need to know what language imports are active. Concretely, uner explicit nulls, the exhaustivity checks for patterns need to know that. We therefore keep language imports until phase PruneErasedDefs. Other imports are dropped in FirstTransform, as before. The handling of statements in MegaPhase was changed so that imports now are visible in the context for transforming the following statements. Fixes scala#14346
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FirstTransform
to keep language imports.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 theMode.SafeNulls
flag accordingly.The text was updated successfully, but these errors were encountered: