Bug 13120 – Body of `foreach` over string with transcoding ignores function attributes
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-13T08:45:00Z
Last change time
2015-02-18T03:37:38Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2014-07-13T08:45:36Z
This code should NOT compile:
---
void f() { }
void g(char[] s) pure @nogc
{
foreach(dchar dc; s)
f();
}
---
The behaviour above is correct for `@safe` attribute, but this attribute fails in case of a template.
This code should NOT compile:
---
void f() { }
void g()(char[] s)
{
foreach(dchar dc; s)
f();
}
void h() @safe pure @nogc
{
g(null);
}
---