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 using
a local clone.
dmd.typesem
Semantic analysis for D types.
Authors:
License:
Source typesem.d
Documentation https://dlang.org/phobos/dmd_typesem.html
- Expression
typeToExpression
(Typet
); - We've mistakenly parsed
t
as a type. Redot
as an Expression.Parameters:Type t
mistaken type Returns:t redone as Expression, null if cannot - Type
typeSemantic
(Typet
, ref const Locloc
, Scope*sc
); - Perform semantic analysis on a type.Parameters:
Type t
Type AST node Loc loc
the location of the type Scope* sc
context Returns:Type with completed semantic analysis, Terror if errors were encountered - RootObject
compileTypeMixin
(TypeMixintm
, Locloc
, Scope*sc
); - Compile the MixinType, returning the type or expression AST.Doesn't run semantic() on the returned object.Parameters:
TypeMixin tm
mixin to compile as a type or expression Loc loc
location for error messages Scope* sc
context Return null if error, else RootObject AST as parsed
- Type
merge
(Typetype
); - If an identical type to
type
is intype
.stringtable, return the latter one. Otherwise, add it totype
.stringtable. Some types don't get merged and are returned as-is.Parameters:Type type
Type to check against existing types Returns:the type that was merged - Expression
getProperty
(Typet
, Scope*scope_
, ref const Locloc
, Identifierident
, intflag
); - Calculate built-in properties which just the type is necessary.Parameters:
Type t
the type for which the property is calculated Scope* scope_
the scope from which the property is being accessed. Used for visibility checks only. Loc loc
the location where the property is encountered Identifier ident
the identifier of the property int flag
if flag & 1, don't report "not a property" error and just return NULL. Returns:expression representing the property, or null if not a property and (flag & 1) - void
resolve
(Typemt
, ref const Locloc
, Scope*sc
, Expression*pe
, Type*pt
, Dsymbol*ps
, boolintypeid
= false); - Resolve type 'mt' to either type, symbol, or expression. If errors happened, resolved to Type.terror.Parameters:
Type mt
type to be resolved Loc loc
the location where the type is encountered Scope* sc
the scope of the type Expression* pe
is set if t is an expression Type* pt
is set if t is a type Dsymbol* ps
is set if t is a symbol bool intypeid
true if in type id - Expression
dotExp
(Typemt
, Scope*sc
, Expressione
, Identifierident
, intflag
); - Access the members of the object e. This type is same as e.type.Parameters:
Type mt
type for which the dot expression is used Scope* sc
instantiating scope Expression e
expression to convert Identifier ident
identifier being used int flag
DotExpFlag bit flags Returns:resulting expression with e.ident resolved - Expression
defaultInit
(Typemt
, ref const Locloc
); - Get the the default initialization expression for a type.Parameters:
Type mt
the type for which the init expression is returned Loc loc
the location where the expression needs to be evaluated Returns:The initialization expression for the type.
Copyright © 1999-2022 by the D Language Foundation | Page generated by
Ddoc on (no date time)