[Issue 22672] New: Allow casting from TypeTuple to TypeTuple
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 13 15:39:05 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22672
Issue ID: 22672
Summary: Allow casting from TypeTuple to TypeTuple
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: hinoda2002 at outlook.jp
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.
--
More information about the Digitalmars-d-bugs
mailing list