Bug 12670 – std.algorithm.sum @nogc for simple cases
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-04-27T22:47:00Z
Last change time
2014-05-26T11:56:03Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2014-04-27T22:47:28Z
import std.algorithm: sum;
auto data = [1];
void main() @nogc {
data.sum;
}
Gives with DMD 2.066alpha:
test.d(4,9): Error: @nogc function 'D main' cannot call non-@nogc function 'std.algorithm.sum!(int[]).sum'
Comment #1 by bearophile_hugs — 2014-05-26T11:56:03Z