Fix Issue 19954 - ICE: Casting AliasSeq to array and passing to a function#10036
Fix Issue 19954 - ICE: Casting AliasSeq to array and passing to a function#10036dlang-bot merged 1 commit intodlang:stablefrom JinShil:fix_19954
Conversation
|
Stable? |
|
Thanks for your pull request and interest in making D better, @JinShil! 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#10036" |
|
rebased to stable |
test/compilable/test19954.d
Outdated
|
|
||
| void main() | ||
| { | ||
| auto a = cast(char[][]) ""; |
There was a problem hiding this comment.
Should this really compile? auto a = cast(int[]) 1; doesn't.
There was a problem hiding this comment.
According to this (run "All dmd com"), yes. But I think "" is more analogous to [] than to 1, and auto a = cast(int[])[]; compiles.
There was a problem hiding this comment.
Ah, a regression. cast(void[][]) [] does compile too, so all good.
|
Should there be a test that actually casts an |
|
Yes please add the test with an alias Seq. If that does not pass then you can add this: + if (exp.e1.type.ty == Ttuple)
+ {
+ TupleExp te = exp.e1.isTupleExp();
+ if (te.exps.dim == 1)
+ exp.e1 = (*te.exps)[0];
+ }around line 6650, just after you're sure that exp.e1.type is a thing. |
Yes, good call. It didn't pass.
Thanks, that worked. |
Best viewed without whitespace changes.