http://d.puremagic.com/issues/show_bug.cgi?id=6487

           Summary: Richer impurity error message
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-08-12 15:27:15 PDT ---
When a function is not pure/safe because it calls a function present elsewhere
the error message is not the best:


import std.bigint, std.math;
void main() {
    auto r = abs(BigInt(-1000));
}


dmd 2.054 gives:

...\src\phobos\std\math.d(251): Error: pure function 'abs' cannot call impure
function 'opCmp'
...\src\phobos\std\math.d(251): Error: safe function 'abs' cannot call system
function 'opCmp'

Here I'd like DMD to print something like:

...\src\phobos\std\math.d(251): Error: pure function 'abs' cannot call impure
function 'std.bigint.BigInt.opCmp'

Or maybe even (but this is getting a bit too much noisy):  

...\src\phobos\std\math.d(251): Error: pure function 'abs' cannot call impure
function '\src\phobos\std\std.bigint.BigInt.opCmp(360)'

If the function is in the same module then it's better to produce a shorter
printout.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to