-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
map with different lengths throws DimensionMismatch, foreach does not #33340
Comments
Trying to understand the problem you're having a bit more. When looking at the
Using slightly different example:
We can see
Would you agree that |
I don't see a reason why it would... Do you? |
One example would be if someone needs to use a jagged array (Multi-dimensional and Jagged Arrays) |
Hmm, I still don't see a situation where you'd want IMHO |
Yup, the 3 from the
I agree that implicitly dropping values would be a frustrating debug session. Thanks for explaining your perspective :) |
Fix at #29927 |
Explanation: Both Map for iterators is
|
Fixed by #29927:
|
The behaviour of using
map
andforeach
on arrays of different lengths is inconsistent:As far as i can tell,
foreach
takes the smallest length of an array passed to it and iterates over that, whereas map just throws aDimensionMismatch
.Probably related to #29523, #13361 and #30389
The text was updated successfully, but these errors were encountered: