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
tas a type. Redotas an Expression only if there are no type modifiers.Parameters:Type tmistaken type Returns:t redone as Expression, null if cannot - MATCH
callMatch(TypeFunctiontf, Typetthis, ArgumentListargumentList, intflag= 0, const(char)**pMessage= null, Scope*sc= null); - 'args' are being matched to function type 'tf' Determine match level.Parameters:
TypeFunction tffunction type Type tthistype of this pointer, null if not member function ArgumentList argumentListarguments to function call int flag1: performing a partial ordering match const(char)** pMessageaddress to store error message, or null Scope* sccontext Returns:MATCHxxxx - Type
typeSemantic(Typetype, const ref Locloc, Scope*sc); - Perform semantic analysis on a type.Parameters:
Type typeType AST node Loc locthe location of the type Scope* sccontext Returns:Type with completed semantic analysis, Terror if errors were encountered - Type
merge(Typetype); - If an identical type to
typeis intype.stringtable, return the latter one. Otherwise, add it totype.stringtable. Some types don't get merged and are returned as-is.Parameters:Type typeType to check against existing types Returns:the type that was merged - Expression
getProperty(Typet, Scope*scope_, const ref Locloc, Identifierident, intflag, Expressionsrc= null); - Calculate built-in properties which just the type is necessary.Parameters:
Type tthe type for which the property is calculated Scope* scope_the scope from which the property is being accessed. Used for visibility checks only. Loc locthe location where the property is encountered Identifier identthe identifier of the property int flagif flag & 1, don't report "not a property" error and just return NULL. Expression srcexpression for type tor null.Returns:expression representing the property, or null if not a property and (flag & 1) - void
resolve(Typemt, const ref Locloc, Scope*sc, out Expressionpe, out Typept, out Dsymbolps, boolintypeid= false); - Resolve type 'mt' to either type, symbol, or expression. If errors happened, resolved to Type.terror.Parameters:
Type mttype to be resolved Loc locthe location where the type is encountered Scope* scthe scope of the type Expression peis set if t is an expression Type ptis set if t is a type Dsymbol psis set if t is a symbol bool intypeidtrue if in type id - Expression
dotExp(Typemt, Scope*sc, Expressione, Identifierident, DotExpFlagflag); - Access the members of the object e. This type is same as e.type.Parameters:
Type mttype for which the dot expression is used Scope* scinstantiating scope Expression eexpression to convert Identifier identidentifier being used DotExpFlag flagDotExpFlag bit flags Returns:resulting expression with e.ident resolved - Expression
defaultInit(Typemt, const ref Locloc, const boolisCfile= false); - Get the default initialization expression for a type.Parameters:
Type mtthe type for which the init expression is returned Loc locthe location where the expression needs to be evaluated bool isCfiledefault initializers are different with C Returns:The initialization expression for the type. - Type
getComplexLibraryType(const ref Locloc, Scope*sc, TYty); - Extract complex type from core.stdc.configParameters:
Loc locfor error messages Scope* sccontext TY tya complex or imaginary type Returns:Complex!float, Complex!double, Complex!real or null for error - Covariant
covariant(Typesrc, Typet, StorageClass*pstc= null, boolcppCovariant= false); - Covariant means that 'src' can substitute for 't', i.e. a pure function is a match for an impure type.Parameters:
Type srcsource type Type ttype 'src' is covariant with StorageClass* pstcif not null, store STCxxxx which would make it covariant bool cppCovarianttrue if extern(C++) function types should follow C++ covariant rules Returns:An enum value of either Covariant.yes or a reason it's not covariant.
Copyright © 1999-2024 by the D Language Foundation | Page generated by
Ddoc on (no date time)