Skip to content

Make new AA allocate the associative array Impl #14257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 25, 2022

Conversation

ntrel
Copy link
Contributor

@ntrel ntrel commented Jun 29, 2022

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

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

@dlang-bot
Copy link
Contributor

dlang-bot commented Jun 29, 2022

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
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
Copy link
Contributor

dkorpel commented Jul 4, 2022

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

@thewilsonator
Copy link
Contributor

Please rebase

@thewilsonator
Copy link
Contributor

is this good to go?

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

ntrel commented Jul 23, 2022

@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
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

auto b = a;
...
a["seven"] = 7;
assert(b["seven"] == 7);
Copy link
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

@@ -1301,6 +1301,16 @@ elem* toElem(Expression e, IRState *irs)
}
e = el_combine(ezprefix, e);
}
else if (auto taa = t.isTypeAArray())
Copy link
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