Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

dmd.access

Enforce visibility contrains such aspublic andprivate.

SpecificationVisibility Attributes

Authors:
Walter Bright
License:
Boost License 1.0

Sourceaccess.d

Documentationhttps://dlang.org/phobos/dmd_access.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/access.d

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. Returns true if the member is not accessible.
boolcheckAccess(Locloc, Scope*sc, Expressione, Dsymbold);
Check access to d for expression e.d Returns true if the declaration is not accessible.
boolcheckAccess(Scope*sc, Packagep);
Check access to package/modulep from scopesc.
Parameters:
Scope*scscope from which to access to a fully qualified package name
Packagepthe package/module to check access for
Returns:
true if 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 (seehttps://issues.dlang.org/show_bug.cgi?id=313).
boolsymbolIsVisible(Modulemod, Dsymbols);
Check whether symbolss is visible inmod.
Parameters:
Modulemodlookup origin
Dsymbolssymbol to check for visibility
Returns:
true if s is visible in mod
boolsymbolIsVisible(Dsymbolorigin, Dsymbols);
Same as above, but determines the lookup module from symbolsorigin.
boolsymbolIsVisible(Scope*sc, Dsymbols);
Same as above but also checks for protected symbols visible from scopesc. Used for qualified name lookup.
Parameters:
Scope*sclookup scope
Dsymbolssymbol to check for visibility
Returns:
true if s is visible by origin
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
Returns:
true if s is visible by origin
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.
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 04:05:43 2026

[8]ページ先頭

©2009-2026 Movatter.jp