[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 --- Comment #10 from Eyal --- Sorry, this is the actual example that showed the dynamic scoping lookup in the PR is incorrect: @safe: unittest { enum Caller { OpApply, Other } struct OpApply { @safe: int

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 --- Comment #9 from Eyal --- In the code review I saw that the PR changed the CTFE to use dynamic scoping lookup instead of lexical scoping so after much IRC back and forth I eventually managed to distill the problematic example to:

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 uplink.co...@googlemail.com changed: What|Removed |Added Assignee|nob...@puremagic.com|uplink.co...@googlemail.com

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 --- Comment #7 from Walter Bright --- Don Clugston writes about this problem: I bet the problem is around dinterpret.d line 4966. --- else if (ecall.op == TOKdelegate) { // Calling a delegate

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 --- Comment #6 from uplink.co...@googlemail.com --- I figured out what is happing. The delegate support code in the ctfe engine takes the parents scope to try and extract a thisPtr. in the case of walters example struct Foo { int i; int

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 uplink.co...@googlemail.com changed: What|Removed |Added CC||uplink.co...@googlemail.com

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 Walter Bright changed: What|Removed |Added Keywords||CTFE --

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 --- Comment #4 from Walter Bright --- The following simpler code reproduces the problem: struct OpApply { void opApply(void delegate() dlg) { dlg(); } } struct Foo { int i;

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 --- Comment #3 from Walter Bright --- (In reply to ag0aep6g from comment #2) > I think you're mistaken. You're right. It is a CTFE problem. --

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 ag0ae...@gmail.com changed: What|Removed |Added CC||ag0ae...@gmail.com --- Comment #2 from

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2017-05-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 Walter Bright changed: What|Removed |Added CC|

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2016-08-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 Ali Cehreli changed: What|Removed |Added Keywords||industry

[Issue 16301] CTFE execution of opApply keeps wrong "this" context in foreach's body

2016-07-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16301 Eyal changed: What|Removed |Added Severity|enhancement |normal --