dmd.access
Enforce visibility contrains such as public and private.
Specification: Visibility Attributes
License
Source: access.d
Documentation: https://dlang.org/phobos/dmd_access.html
-
Declaration
boolcheckAccess(AggregateDeclarationad, Locloc, Scope*sc, Dsymbolsmember);Do access check for member of this class, this class being the type of the 'this' pointer used to access
smember. Returnstrueif the member is not accessible. -
Declaration
boolcheckAccess(Locloc, Scope*sc, Expressione, Dsymbold);Check access to
dfor expressione.dReturnstrueif the declaration is not accessible. -
Declaration
boolcheckAccess(Scope*sc, Packagep);Check access to package/module
from scopep.scParameters
Scope*scscope from which to access to a fully qualified package name
Packagepthe package/module to check access for
Return Value
trueif the package is not accessible.
Because a global symbol table tree is used for imported packages/modules, access to them needs to be checked based on the imports in the scope chain (see https://issues.dlang.org/show_bug.cgi?id=313). -
Declaration
boolsymbolIsVisible(Modulemod, Dsymbols);Check whether symbols
is visible ins.modParameters
Modulemodlookup origin
Dsymbolssymbol to check for visibility
Return Value
trueifsis visible inmod -
Declaration
boolsymbolIsVisible(Dsymbolorigin, Dsymbols);Same as above, but determines the lookup module from symbols
.origin -
Declaration
boolsymbolIsVisible(Scope*sc, Dsymbols);Same as above but also checks for protected symbols visible from scope
. Used for qualified name lookup.scParameters
Scope*sclookup scope
Dsymbolssymbol to check for visibility
Return Value
trueifsis visible by origin -
Declaration
boolcheckSymbolAccess(Scope*sc, Dsymbols);Check if a symbol is visible from a given scope without taking into account the most visible overload.
Parameters
Scope*sclookup scope
Dsymbolssymbol to check for visibility
Return Value
trueifsis visible by origin -
Declaration
DsymbolmostVisibleOverload(Dsymbols, Modulemod= null);Use the most visible overload to check visibility. Later perform an access check on the resolved overload. This function is similar to overloadApply, but doesn't recurse nor resolve aliases because visibility is an attribute of the alias not the aliasee.