resolveStructLiteralNamedArgs

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

Expressions*
resolveStructLiteralNamedArgs
(,,,,,
scope Expression delegate
(
size_t i
,)
getExp
,
scope Loc delegate
(
size_t i
)
getLoc
)

Parameters

sd StructDeclaration

struct

t Type

type of struct (potentially including qualifiers such as const or immutable)

sc Scope*

scope of the expression initializing the struct

iloc Loc

location of expression initializing the struct

names Identifier[]

identifiers passed in argument list, null entries for positional arguments

getExp Expression delegate

function that, given an index into names and destination type, returns the initializing expression

getLoc Loc delegate

function that, given an index into names, returns a location for error messages

Return Value

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

Meta