https://issues.dlang.org/show_bug.cgi?id=13120
Issue ID: 13120
Summary: Body of `foreach` over string with transcoding ignores
function attributes
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
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);
}
---
--