http://d.puremagic.com/issues/show_bug.cgi?id=6690
Summary: Using lazy parameter is inferred as unsafe 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: k.hara...@gmail.com --- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2011-09-18 15:25:16 PDT --- We cannot use std.exception.enforceEx in @safe function. import std.exception; void test1() @safe { enforceEx!Exception(true, ""); // Error: safe function 'test1' cannot call system function 'enforceEx' } This is dmd bug, using lazy parameter is inferred as unsafe, so whole enforceEx calling is inferred as unsafe. More simple test case. T useLazy(T)(lazy T val) { return val; } void test2() @safe { useLazy(0); // Error: safe function 'test2' cannot call system function 'useLazy' } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------