[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-08-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

--- Comment #8 from github-bugzi...@puremagic.com ---
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/2e6c7ac3af5ec52aff63a779e781cab1a802dfa5
fix Issue 17545 - [REG2.072] __traits(getAttributes, name) evaluates name to
value prematurely

https://github.com/dlang/dmd/commit/1227633d355b0a6ab8f65d82247fcf0d5012129e
Merge pull request #6949 from WalterBright/fix17545

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-07-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

--- Comment #7 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/2e6c7ac3af5ec52aff63a779e781cab1a802dfa5
fix Issue 17545 - [REG2.072] __traits(getAttributes, name) evaluates name to
value prematurely

https://github.com/dlang/dmd/commit/1227633d355b0a6ab8f65d82247fcf0d5012129e
Merge pull request #6949 from WalterBright/fix17545

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-07-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

--- Comment #6 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/2e6c7ac3af5ec52aff63a779e781cab1a802dfa5
fix Issue 17545 - [REG2.072] __traits(getAttributes, name) evaluates name to
value prematurely

https://github.com/dlang/dmd/commit/1227633d355b0a6ab8f65d82247fcf0d5012129e
Merge pull request #6949 from WalterBright/fix17545

fix Issue 17545 - [REG2.072] __traits(getAttributes, name) evaluates …
merged-on-behalf-of: Martin Nowak 

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-07-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

--- Comment #5 from Walter Bright  ---
https://github.com/dlang/dmd/pull/6949

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #4 from Walter Bright  ---
(In reply to Vladimir Panteleev from comment #3)
> Introduced in https://github.com/dlang/dmd/pull/5588

Timon Gehr notes that it was this diff that caused the issue:

https://github.com/dlang/dmd/compare/master...tgehr:fix17545

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

Vladimir Panteleev  changed:

   What|Removed |Added

 CC||dlang-bugzilla@thecybershad
   ||ow.net

--- Comment #3 from Vladimir Panteleev  ---
Introduced in https://github.com/dlang/dmd/pull/5588

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

--- Comment #2 from monkeywork...@hotmail.com ---
If you don't want to modify the enum the following code also seems to work. The
main thing is to avoid using __traits(getMember) which could get passed a
non-symbol.

module example;
import std.meta: staticIndexOf;
import std.traits;

struct Attrib {}

@Attrib enum TEST = 123;

void foo() {
foreach(sym; getSymbolsByUDA!(example, Attrib)) {
pragma(msg, sym.stringof); //Prints 123
}
}

The fact that it prints 123 instead of TEST seems to suggest that it is indeed
a problem with the compiler pasting the value where the identifier is used. I'd
recommend taking a look at the implementation of getSymbolsByUDA to see how
it's done there.

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

Ketmar Dark  changed:

   What|Removed |Added

 CC||ket...@ketmar.no-ip.org

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

monkeywork...@hotmail.com changed:

   What|Removed |Added

 CC||monkeywork...@hotmail.com

--- Comment #1 from monkeywork...@hotmail.com ---
This code is *supposed* to be equivalent as far as I know, but it actually
fixes the issue. Change `@Attrib enum TEST = 123` to `@Attrib enum TEST { val =
123; }` and it will compile (you can also make it immutable; basically anything
that introduces an actual symbol).

I think it's because the compiler does not even see the enum; the symbol TEST
is replaced with the actual value at the usage site so it's like you're doing
`pragma(msg, __traits(getAttributes, 123))`, which of course doesn't make any
sense.

--


[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545

johanenge...@weka.io changed:

   What|Removed |Added

Summary|[REG2.072]  |[REG2.072]
   |__traits(getMember, mod,|__traits(getAttributes,
   |name) evaluates enum to |name) evaluates name to
   |value prematurely   |value prematurely

--