Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Change _aaNew to return Impl*, not AA #3871

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/rt/aaA.d
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,9 @@ pure nothrow @nogc unittest
* Returns:
* A new associative array.
*/
extern (C) AA _aaNew(const TypeInfo_AssociativeArray ti)
extern (C) Impl* _aaNew(const TypeInfo_AssociativeArray ti)
{
AA aa;
aa.impl = new Impl(ti);
return aa;
return new Impl(ti);
}

/// Determine number of entries in associative array.
Expand Down Expand Up @@ -750,7 +748,15 @@ extern (C) int _aaApply2(AA aa, const size_t keysz, dg2_t dg)
return 0;
}

/// Construct an associative array of type ti from keys and value
/** Construct an associative array of type ti from corresponding keys and values.
* Called for an AA literal `[k1:v1, k2:v2]`.
* Params:
* ti = TypeInfo for the associative array
* keys = array of keys
* vals = array of values
* Returns:
* A new associative array opaque pointer, or null if `keys` is empty.
*/
extern (C) Impl* _d_assocarrayliteralTX(const TypeInfo_AssociativeArray ti, void[] keys,
void[] vals)
{
Expand Down