-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Fix Issue 20465 - Dynamic + static array declaration fail #10698
Conversation
|
Thanks for your pull request and interest in making D better, @MoonlightSentinel! 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 fetch digger
dub run digger -- build "stable + dmd#10698" |
470c720 to
5e2290d
Compare
5e2290d to
fd1216e
Compare
|
Looks like you botched the rebase. |
|
Isn't it a bit too lax tho ?We always had the ability to assign a value to a slice, but never to assign a value to a multi dimensional array. Also, does it work with |
fd1216e to
99d7058
Compare
Fixed
Maybe, but there was always a discrepancy between the initial construction and further usage of static arrays
This change applies to assignment/construction of an static array, do you have a specific example? |
For starter: int[3][] arr = new int[3][5];
arr = 42;But you can extend it to EDIT: Also, there's a reason why the discrepancy is possible. When you construct the array, you specify the type, while when you assign it, you don't. |
These are dynamic arrays and hence unaffected by this patch. |
99d7058 to
686c108
Compare
|
Lets defer the discussion about the differences between construction and assignment to another PR as its not required to fix this regression (unless the test suite disagrees). Got kinda carried away there ... |
Implements a cleaner solution for issue 10562 which tries to match the assigned expression against all dimensions of the target (instead of bluntly rewriting to keep type safety). Rewrites the original test to orderly check all possible combinations.
686c108 to
6ce09f8
Compare
|
@Geod24 Restored the original restriction to non-assignments and adapted the test accordingly |
|
Can this be merged or should we revert the faulty PR until we come to a conclusion? (Since the next release is due in a few days) |
Implements a cleaner solution for issue 10562 which tries to match the assigned expression against all dimensions of the target (instead of simply rewriting to keep type safety).
Rewrites the original test to orderly check all possible combinations.