Currently DMD does not allow casting to TypeTuple even if they
are the same type is.
---
alias Tuple(T...) = T;
void foo()
{
Tuple!(int, int) tup;
cast(Tuple!(int, int)) tup; // Error: cannot cast `tuple(__tup_field_0, __tup_field_1)` to tuple type `(int, int)`
}
---
This is a bit odd, so I think it would be better it only allows it in certain case.
Comment #1 by dlang-bot — 2022-01-13T16:08:48Z
@kubo39 updated dlang/dmd pull request #13501 "Fix Issue 22672 - Allow casting from TypeTuple to TypeTuple" fixing this issue:
- Fix Issue 22672 - Allow casting from TypeTuple to TypeTuple
Currently DMD does not allow casting to TypeTuple even if they
are the same type is.
This is a bit odd, so only allow it in certain case.
Co-authored-by: Boris Carvajal <[email protected]>
https://github.com/dlang/dmd/pull/13501
Comment #2 by dlang-bot — 2022-01-14T18:31:25Z
dlang/dmd pull request #13501 "Fix Issue 22672 - Allow casting from TypeTuple to TypeTuple" was merged into master:
- bba9b31ba111a52695802fe768327a14eb990a2a by Hiroki Noda:
Fix Issue 22672 - Allow casting from TypeTuple to TypeTuple
Currently DMD does not allow casting to TypeTuple even if they
are the same type is.
This is a bit odd, so only allow it in certain case.
Co-authored-by: Boris Carvajal <[email protected]>
Co-authored-by: Razvan Nitu <[email protected]>
https://github.com/dlang/dmd/pull/13501