Commit Graph

3 Commits

Author SHA1 Message Date
Becca Royal-Gordon
3732c75e97 Adopt %kind for certain access control diagnostics
These particular changes slightly alter some diagnostics.
2023-07-19 13:06:51 -07:00
Alexis Laferrière
a26fbd2849 [Sema] Improve note on access-level downgrade from import
Using an access-level on an import downgrades imported decl from public
to the import's access-level. When we can identify which decl is
problematic, name it in the note displayed on the import. This should
help understanding the effect of the import's access level on the decl
causing an error further down in the source file.
2023-03-09 09:08:42 -08:00
Alexis Laferrière
75255d153c [Sema] Diagnose exportability of decls limited by a non-public import
Check the API of decls to ensure that imported types are only used in
decls with compatible access-level. For example, error on using a type
import as internal in a public function, but allow it in internal
functions and lower.

This change raises errors on wrongful use of types limited by an import
and offers a note pointing to the import that did limit the imported
type.
2023-03-01 18:35:41 -08:00