http://d.puremagic.com/issues/show_bug.cgi?id=9875
Summary: opDispatch is wrongly set to safe
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrej Mitrovic <[email protected]> 2013-04-04
07:17:16 PDT ---
import std.string;
mixin template Mixin()
{
auto test()() // must be template to reproduce
{
static struct Dispatch // move outside of 'test' and it works
{
void opDispatch(string name, Args...)(Args args)
{
assert(0, format("%s", ""));
}
}
return Dispatch();
}
}
mixin Mixin!();
void main()
{
test().foo();
}
Error: safe function 'test.Mixin!().test!().test.Dispatch.opDispatch!("foo",
).opDispatch' cannot call system function 'std.string.format!(char,
string).format'
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------