Bug 21737 – shared opApply does not compile

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-20T00:10:47Z
Last change time
2024-12-13T19:15:17Z
Keywords
pull
Assigned to
No Owner
Creator
Nicholas Wilson
Moved to GitHub: dmd#19891 →

Comments

Comment #0 by iamthewilsonator — 2021-03-20T00:10:47Z
struct Foo { int opApply( int delegate(size_t, int) shared scope) shared { return 0; } } void main() { shared Foo foo; foreach(i, e; foo) { } } test.d(11): Error: function `test.opApply(int delegate(ulong, int) shared scope _param_0) shared` is not callable using argument types `(int delegate(ulong i, int e) pure nothrow @nogc @safe) shared` test.d(11): cannot pass argument `__foreachbody2` of type `int delegate(ulong i, int e) pure nothrow @nogc @safe` to parameter `int delegate(ulong, int) shared scope _param_0` expected: no error
Comment #1 by dlang-bot — 2021-03-20T00:18:06Z
@thewilsonator created dlang/dmd pull request #12290 "Fix issue 21737: shared opApply does not compile" fixing this issue: - Fix issue 21737: shared opApply does not compile https://github.com/dlang/dmd/pull/12290
Comment #2 by robert.schadek — 2024-12-13T19:15:17Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19891 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB