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
Issue 6288 - std.conv.to removes const/immutable when converting a class #271
Conversation
Wow, nice exhaustive unit tests, Jonathan would be proud :) It took me a while to figure out what's going on in there. You may want to add a comment, it's quite confusing, yet cool. The other changes look good. Assuming this passes unit tests, it can be merged IMO. |
static if (n == 1) alias toConst Mod2Conv; | ||
static if (n == 2) alias toShared Mod2Conv; | ||
static if (n == 3) alias toSharedConst Mod2Conv; | ||
static if (n == 4) alias toImmutable Mod2Conv; |
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.
It's not a big deal, but I'd use else static if
instead of using static if
for each branch. It's more logically correct in the sense that it's not possible for more than one branch to be correct and the else static if
reflects that whereas use static if
for all of them does not, but it likely speeds up compilation as well (obviously not by much, but every bit adds up), since it doesn't have to evaluate the secondary branches.
LOL. Yeah. Gotta love the thoroughness of those unit tests. Maybe I've been writing too many unit tests like that though, since I don't really find them particularly confusing (though they are the sort of tests that you have to read carefully). |
@schveiguy @jmdavis |
Issue 6288 - std.conv.to removes const/immutable when converting a class
Gah, I just merged it. But there is no change to changelog.dd, can you do that Hari? Just do it directly, no need to post pull request. |
Pushed it. Thanks. |
Use "-i" to prevent rdmd from having to invoke compiler twice.
http://d.puremagic.com/issues/show_bug.cgi?id=6288