Re: bug in compiles?

2019-04-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/12/19 5:43 AM, Jacob Carlborg wrote: The problem is that "__traits(getAttributes, T)" in it self is not valid code. It needs to be part of larger expression or statement. It does work, as long as it's not an alias passed into a template: void main() { @(3) int a; static

Re: bug in compiles?

2019-04-12 Thread Alex via Digitalmars-d-learn
pen, but I believe static if works here without issue. If so this means that it is a bug. Maybe compiles can have handle certain primitives(such as bools here) but not others(such as tuples in the main case)? It would make little sense to be forced to use a temp variable: static if (__traits(compil

Re: bug in compiles?

2019-04-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-04-11 20:13, Alex wrote: The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T)))    static foreach(a;  __traits(getAttributes, T)) Attributes ~= There seems to be absolutely no reason why this code would fail with the

Re: bug in compiles?

2019-04-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/11/19 6:45 PM, Alex wrote: On Thursday, 11 April 2019 at 19:42:05 UTC, Steven Schveighoffer wrote: On 4/11/19 2:13 PM, Alex wrote: The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T)))     static foreach(a; 

Re: bug in compiles?

2019-04-11 Thread Alex via Digitalmars-d-learn
On Friday, 12 April 2019 at 00:02:36 UTC, Seb wrote: On Thursday, 11 April 2019 at 23:55:18 UTC, Alex wrote: to judge people objectively. This isn't a nursery school and we are not 3 year olds... Exactly. So start behaving like a grown-up and professional. When you ask someone for help on

Re: bug in compiles?

2019-04-11 Thread Seb via Digitalmars-d-learn
On Thursday, 11 April 2019 at 23:55:18 UTC, Alex wrote: to judge people objectively. This isn't a nursery school and we are not 3 year olds... Exactly. So start behaving like a grown-up and professional. When you ask someone for help on the street, do you curse at him too?

Re: bug in compiles?

2019-04-11 Thread Alex via Digitalmars-d-learn
On Thursday, 11 April 2019 at 23:04:46 UTC, Mike Parker wrote: On Thursday, 11 April 2019 at 22:41:32 UTC, Alex wrote: Seriously? Do you think you have ESP? Your code isn't even close to was talking about ;/ Here is is updated that shows the error. You seem to fail to understand that it

Re: bug in compiles?

2019-04-11 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 11 April 2019 at 22:41:32 UTC, Alex wrote: Seriously? Do you think you have ESP? Your code isn't even close to was talking about ;/ Here is is updated that shows the error. You seem to fail to understand that it is impossible for it to be my code. If you continue to attack

Re: bug in compiles?

2019-04-11 Thread Alex via Digitalmars-d-learn
On Thursday, 11 April 2019 at 19:42:05 UTC, Steven Schveighoffer wrote: On 4/11/19 2:13 PM, Alex wrote: The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T)))    static foreach(a;  __traits(getAttributes, T)) Attributes ~=

Re: bug in compiles?

2019-04-11 Thread Alex via Digitalmars-d-learn
On Thursday, 11 April 2019 at 20:49:45 UTC, bauss wrote: On Thursday, 11 April 2019 at 18:13:48 UTC, Alex wrote: The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T))) static foreach(a; __traits(getAttributes, T)) Attributes

Re: bug in compiles?

2019-04-11 Thread bauss via Digitalmars-d-learn
On Thursday, 11 April 2019 at 18:13:48 UTC, Alex wrote: The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T))) static foreach(a; __traits(getAttributes, T)) Attributes ~= There seems to be absolutely no reason why this code

Re: bug in compiles?

2019-04-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/11/19 2:13 PM, Alex wrote: The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T)))    static foreach(a;  __traits(getAttributes, T)) Attributes ~= There seems to be absolutely no reason why this code would fail with the

bug in compiles?

2019-04-11 Thread Alex via Digitalmars-d-learn
The following code works when I comment out the static if //static if (__traits(compiles, __traits(getAttributes, T))) static foreach(a; __traits(getAttributes, T)) Attributes ~= There seems to be absolutely no reason why this code would fail with the static if but pass without it but in