Skip to content

Make new AA allocate the associative array Impl#14257

Merged
thewilsonator merged 9 commits into
dlang:masterfrom
ntrel:new-aa
Jul 25, 2022
Merged

Make new AA allocate the associative array Impl#14257
thewilsonator merged 9 commits into
dlang:masterfrom
ntrel:new-aa

Conversation

@ntrel

@ntrel ntrel commented Jun 29, 2022

Copy link
Copy Markdown
Contributor

Fixes Issue 10535.
https://issues.dlang.org/show_bug.cgi?id=10535.

Requires dlang/druntime#3863. See description there for justification.

@dlang-bot

dlang-bot commented Jun 29, 2022

Copy link
Copy Markdown

Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
2 critical Hook up new dmd command line arguments

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14257"

@thewilsonator

Copy link
Copy Markdown
Contributor

cc @kinke @ibuclaw this changes glue code

@ntrel ntrel changed the title Make new on an associative array allocate the AA Impl Make new AA allocate the associative array Impl Jun 30, 2022
@ntrel ntrel closed this Jul 3, 2022
@ntrel ntrel reopened this Jul 3, 2022
@dkorpel

dkorpel commented Jul 4, 2022

Copy link
Copy Markdown
Contributor

I think you need to git rebase upstream/master so the tests pick up your commit in druntime.

@thewilsonator

Copy link
Copy Markdown
Contributor

Please rebase

@thewilsonator

Copy link
Copy Markdown
Contributor

is this good to go?

@ntrel ntrel marked this pull request as ready for review July 23, 2022 14:30
@ntrel

ntrel commented Jul 23, 2022

Copy link
Copy Markdown
Contributor Author

@thewilsonator Yes, now marked as ready.

// e.g. `new Alias(args)`
if (nargs)
{
exp.error("`new` cannot take arguments for an associative array");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test for this

Comment thread test/runnable/newaa.d Outdated
Comment thread changelog/new-aa.dd
auto b = a;
...
a["seven"] = 7;
assert(b["seven"] == 7);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a good addition to the runnable test

Comment thread compiler/src/dmd/e2ir.d
}
e = el_combine(ezprefix, e);
}
else if (auto taa = t.isTypeAArray())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why Codecov says this isn't covered, it has to be or else the runnable test wouldn't work right?

@thewilsonator thewilsonator merged commit 418230d into dlang:master Jul 25, 2022
@ntrel ntrel deleted the new-aa branch July 27, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants