-
-
Notifications
You must be signed in to change notification settings - Fork 740
More fix for Issue 8705 - std.conv.to bug, from documentation #844
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
MV2 mv2 = to!MV2(v1); //Value must be kept mutable for insertion | ||
result[k2] = mv2; | ||
// Cast values temporarily to Unqual!V2 to store them to result variable | ||
result[to!K2(k1)] = cast(Unqual!V2) to!(V2)(v1); |
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.
nitpitck: to!V2(v1)
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.
Thanks. WIll fix.
Mutable care is just necessary for value type, and doesn't need for key types.
LGTM, but I think extra unit tests are too hard on the linker. I had the exact same problem, hence the commented tests in the code. What is odd is that it works on my machine (2.060, x64 win). Work on yours? Must be some kind of regression. |
Ouch, it is like this? |
Yeah, I think the best you can do is comment the tests, and file a bug report. I was planning to get around to it, but haven't done it yet. |
OK. Now, auto tester results are all green. |
MV2[MK2] result; | ||
|
||
// While we are "building" the AA, we need to unqualify its values, and only re-qualify at the end | ||
Unqual!V2[K2] result; |
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.
More nitpick: Isn't that just Unqual!T
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.
No, this is core part of the bug 8705.
If T
is const(int[int])
, Unqual!T
returns const(int)[int]
. This is correct Unqual
behavior, but has no meaning here.
Instead, Unqual!V2[K2]
constructs int[int]
, it has a mutable values, and as far as written in comment, it allows assign in whole building the result.
More fix for Issue 8705 - std.conv.to bug, from documentation
merged thanks |
http://d.puremagic.com/issues/show_bug.cgi?id=8705
Mutable care is just necessary for value type, and doesn't need for key types.
@monarchdodra, how about this change?