Revisit the visibility check in type_resolve #6840
Labels
compiler: collection
Everything to do with graph collection, type collection, and the collection context.
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
The function
resolve_call_path
intype_resolve.rs
in some cases performs a visibility check of the path being resolved. However, the visibility check is insufficient, because the prefixes of the path are only checked for visibility if the prefix refers to a module.For example, for the path
MyPackage::MyModule::MySubmodule::MyEnum::MyEnumVariant
we do not check the visibility ofMyEnum
, since this identifier refers to an enum rather than to a module.Note that accessing a private item is legal if the access is performed through a reexport, so it is not entirely trivial to solve this problem.
The text was updated successfully, but these errors were encountered: