-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Conversation
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 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
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#14257" |
new
on an associative array allocate the AA Implnew AA
allocate the associative array Impl
I think you need to |
Please rebase |
is this good to go? |
@thewilsonator Yes, now marked as ready. |
// e.g. `new Alias(args)` | ||
if (nargs) | ||
{ | ||
exp.error("`new` cannot take arguments for an associative array"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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?
Fixes Issue 10535.
https://issues.dlang.org/show_bug.cgi?id=10535.
Requires dlang/druntime#3863. See description there for justification.