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 abc() { void dg() { i = 0; } // value of 'this' is not known at compile time // dg's direct parent is the function abc, which // does not have a this (because it's a function) opApply(&dg); return 0; } } void bar() { enum x = Foo().abc(); } I am working on a solution. It should work in a couple of days. --