[Issue 10319] New: @safe/pure/nothrow error should print fully qualified name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 9 22:32:33 PDT 2013


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

           Summary: @safe/pure/nothrow error should print fully qualified
                    name
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-06-09 22:32:31 PDT ---
Test case:

void foo() {}

void bar(T)()
{
    static int g; g = 10;       // impure
    int x; auto p = &x;         // system
    throw new Exception("");    // throwing
}

@safe pure nothrow void main()  // L10
{
    foo();      // L12
    bar!int();  // L13
}


Current error output:

test.d(12): Error: pure function 'D main' cannot call impure function
'test.foo'
test.d(12): Error: safe function 'D main' cannot call system function
'test.foo'
test.d(13): Error: pure function 'main' cannot call impure function 'bar'
test.d(13): Error: safe function 'D main' cannot call system function
'test.bar!(int).bar'
test.d(12): Error: foo is not nothrow
test.d(13): Error: bar is not nothrow
test.d(10): Error: function D main 'main' is nothrow yet may throw


Expected error output:

test.d(12): Error: pure function 'D main' cannot call impure function
'test.foo'
test.d(12): Error: safe function 'D main' cannot call system function
'test.foo'
test.d(13): Error: pure function 'D main' cannot call impure function
'test.bar!(int).bar'
test.d(13): Error: safe function 'D main' cannot call system function
'test.bar!(int).bar'
test.d(12): Error: 'test.foo' is not nothrow
test.d(13): Error: 'test.bar!(int).bar' is not nothrow
test.d(10): Error: function 'D main' is nothrow yet may throw

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


More information about the Digitalmars-d-bugs mailing list