http://d.puremagic.com/issues/show_bug.cgi?id=7452
Summary: Function using enforce() cannot be inferred as @safe because of the lazy argument Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: kenn...@gmail.com --- Comment #0 from kenn...@gmail.com 2012-02-06 13:22:40 PST --- Test case: ---------------------------------- import std.exception; int f7452()(int x) { enforce(x > 0); return x; } void g7452() @safe pure { assert(4 == f7452(4)); } ---------------------------------- This caused error: Error: safe function 'g7452' cannot call system function 'f7452' This is because of the lazy argument, as shown with this minimal D-only test case: ---------------------------------- void e7452b(int, lazy int) pure nothrow @safe {} int f7452b()(int x) { e7452b(x, 0); return x; } void g7452b() pure nothrow @safe { assert(4 == f7452b(4)); } ---------------------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------