dmd.initsem
Semantic analysis of initializers.
License
Source: initsem.d
Documentation: https://dlang.org/phobos/dmd_initsem.html
- 
  DeclarationExpressiontoAssocArrayLiteral(ArrayInitializerai);If possible, convert array initializer to associative array initializer. ParametersArrayInitializeraiarray initializer to be converted Return ValueThe converted associative array initializer or ErrorExp if ai
- 
  DeclarationInitializerinitializerSemantic(Initializerinit, Scope*sc, ref Typetx, NeedInterpretneedInterpret);Perform semantic analysis on init.ParametersInitializerinitInitializer AST node Scope*sccontext Typetxtype that the initializer needs to become. If txis an incomplete type and the initializer completes it, it is updated to be the complete type. ImportC has incomplete typesNeedInterpretneedInterpretif CTFE needs to be run on this, such as if it is the initializer for a const declaration Return ValueInitializerwith completed semantic analysis,ErrorInitializerif errors were encountered
- 
  DeclarationInitializerinferType(Initializerinit, Scope*sc);Translate initto anExpressionin order to infer the type.ParametersInitializerinitInitializerAST nodeScope*sccontext Return Valuean equivalent ExpInitializerif successful, orErrorInitializerif it cannot be translated
- 
  DeclarationExpressioninitializerToExpression(Initializerinit, Typeitype= null, const boolisCfile= false);Translate initto anExpression.ParametersInitializerinitInitializerAST nodeTypeitypeif not null, type to coerce expression toboolisCfiledefault initializers are different with C Return ValueExpressioncreated,nullif cannot,ErrorExpfor other errors
- 
  DeclarationExpressions*resolveStructLiteralNamedArgs(StructDeclarationsd, Typet, Scope*sc, Lociloc, Identifier[]names, scope Expression delegate(size_t i, Type fieldType)getExp, scope Loc delegate(size_t i)getLoc);Given the namesand values of aStructInitializerorCallExp, resolve it to a list of expressions to construct aStructLiteralExp.ParametersStructDeclarationsdstruct Typettype of struct (potentially including qualifiers such as constorimmutable)Scope*scscope of the expression initializing the struct Lociloclocation of expression initializing the struct Identifier[]namesidentifiers passed in argument list, nullentries for positional argumentsExpression delegate(size_t i, Type fieldType)getExpfunction that, given an index into namesLoc delegate(size_t i)getLocfunction that, given an index into namesReturn Valuelist of expressions ordered to the struct's fields, or nullon error