Skip to content

ExplicitLevelImports: check staging for types just like for values

Previously, imported types were entirely exempted from staging checks as the implicit stage persistance assumed to be all imported types to be well staged. ExplicitLevelImports' change specification, however, does not do such an exemption. Thus we want to introduce such a check, just like we have for values. ExplicitLevelImports does not, however, talk about local names - from its perspective, we could theoretically keep treating locally introduced types specially - e.g. an ill-staged used in a quote would only emit a warning, not an error. To allow for a potential future migration away from such wrinkles as the staging check in notFound (see Note [Out of scope might be a staging error]) we consistently do the strict staging check that we also do for value if ExplicitLevelImports is on.

This MR thus also contains a design decision - we could theoretically run checkThLocalTyName when explicit_level_imports == False and only run checkThLocalNameNoLift if the name is not local

This MR is still missing adjustments of the testsuite and thus is a Draft

Closes #26098 (closed)

Merge request reports

Loading