template bug?

gedaiu via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 4 03:23:30 PST 2014


On Wednesday, 3 December 2014 at 18:25:41 UTC, bearophile wrote:
> Ali Çehreli:
>
>> Attempting to compile with a recent dmd git head causes 
>> segmentation fault. Any compiler crash is a compiler bug. 
>> Please report it at
>>
>>  https://issues.dlang.org/
>>
>> Ali
>
> A first reduction for Bugzilla:
>
>
> alias TypeTuple(T...) = T;
> struct A {
>     void foo() {}
> }
> template ItemProperty(item, string method) {
>     static if(__traits(getProtection, ItemProperty!(item, 
> method)).stringof)
>         alias ItemProperty = TypeTuple!(ItemProperty!(item, 
> method));
> }
> void main() {
>     auto l = ItemProperty!(A, "foo").length;
> }
>
>
> Bye,
> bearophile

Thanks for the code revised version. I thought that the compiler 
crashes because I was trying to get the access of an overrided 
method.

Bogdan


More information about the Digitalmars-d-learn mailing list