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 delegate(Caller) @sa
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:
@safe:
unittest
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
---
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
fd = (cast(Deleg
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 ab
https://issues.dlang.org/show_bug.cgi?id=16301
uplink.co...@googlemail.com changed:
What|Removed |Added
CC||uplink.co...@googlemail.com
---
https://issues.dlang.org/show_bug.cgi?id=16301
Walter Bright changed:
What|Removed |Added
Keywords||CTFE
--
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;
int abc() {
auto o = O
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.
--
https://issues.dlang.org/show_bug.cgi?id=16301
ag0ae...@gmail.com changed:
What|Removed |Added
CC||ag0ae...@gmail.com
--- Comment #2 from a
https://issues.dlang.org/show_bug.cgi?id=16301
Walter Bright changed:
What|Removed |Added
CC||bugzi...@digitalmars.com
--- Comment #1 from
https://issues.dlang.org/show_bug.cgi?id=16301
Ali Cehreli changed:
What|Removed |Added
Keywords||industry
CC|
https://issues.dlang.org/show_bug.cgi?id=16301
Eyal changed:
What|Removed |Added
Severity|enhancement |normal
--
13 matches
Mail list logo