[Issue 19420] New: [master] TypeTrait semantic fails for non static aggregate members
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 21 21:13:38 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19420
Issue ID: 19420
Summary: [master] TypeTrait semantic fails for non static
aggregate members
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: b2.temp at gmx.com
With DMD ~master
---
alias Seq(T...) = T;
class One
{
int foo;
void test()
{
alias p1 = Seq!(__traits(getMember, this, "foo"))[0];
alias p2 = __traits(getMember, this, "foo");
static assert(__traits(isSame, p1, p2));
}
}
void main(){}
---
gives:
----
Error: static assert: `__traits(isSame, foo, int)` is false
----
with the new syntax `foo` is replaced by to its type:
TypeTrait semantic tries getSymbol() on the trait. If this fails, it calls
getType() which takes the type of the expression when this expression is not a
type.
There's something missing to transform the trait in dsymbol before it falls
back to getType()
--
More information about the Digitalmars-d-bugs
mailing list