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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri May 12 09:33:48 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=16301

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
The same error:

test.d(10): Error: couldn't find field i of type int in OpApply()
test.d(3):        called from here: dlg(1)
test.d(9):        called from here: OpApply().opApply(delegate int(int _) => 0)
test.d(14):        called from here: Foo(0).this(1)

happens when `enum` is replaced with `auto` so it is not specific to CTFE.

--


More information about the Digitalmars-d-bugs mailing list