Bug 8595 – typeof(return) inside opApply loop always int
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-08-28T09:08:00Z
Last change time
2012-09-06T19:31:44Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2012-08-28T09:08:52Z
Probably related to the way opApply works under the hood, as a delegate that returns int.
struct OpApply {
int opApply(int delegate(ref int) dg) {
assert(0);
}
}
void main() {
doIt();
}
string doIt() {
foreach(elem; OpApply.init) {
pragma(msg, typeof(return)); // int, should be string
}
assert(0);
}