[Issue 23360] New: Template alias to tuple member variable doesn't expand
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 22 13:14:03 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23360
Issue ID: 23360
Summary: Template alias to tuple member variable doesn't expand
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.100.2, the following program fails to compile:
---
alias AliasSeq(Args...) = Args;
struct Foo {
AliasSeq!(int) tuple;
alias slice() = tuple;
}
void main() {
Foo foo;
AliasSeq!(int) t = foo.slice!();
}
---
The error message is:
---
bug.d(10): Error: cannot implicitly convert expression
`foo.tuple(__tuple_field_0)` of type `(int)` to `int`
---
In other words, the tuple expression on the right-hand side is not expanded,
which causes a type mismatch.
--
More information about the Digitalmars-d-bugs
mailing list