View source code
Display the source code in dmd/initsem.d from which this page was generated on github.
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 local clone.

Function dmd.initsem.resolveStructLiteralNamedArgs

Given the names and values of a StructInitializer or CallExp, resolve it to a list of expressions to construct a StructLiteralExp.

dmd.root.array.Array!(dmd.expression.Expression)* resolveStructLiteralNamedArgs (
  StructDeclaration sd,
  Type t,
  dmd.dscope.Scope* sc,
  Loc iloc,
  Identifier[] names,
  scope Expression delegate(ulong, Type) getExp,
  scope Loc delegate(ulong) getLoc
);

Parameters

NameDescription
sd struct
t type of struct (potentially including qualifiers such as const or immutable)
sc scope of the expression initializing the struct
iloc location of expression initializing the struct
names identifiers passed in argument list, null entries for positional arguments
getExp function that, given an index into names and destination type, returns the initializing expression
getLoc function that, given an index into names, returns a location for error messages

Returns

list of expressions ordered to the struct's fields, or null on error

Authors

Walter Bright

License

Boost License 1.0