Thread overview
[Issue 10319] New: @safe/pure/nothrow error should print fully qualified name
Jun 10, 2013
Kenji Hara
Jun 10, 2013
Kenji Hara
Jun 10, 2013
Kenji Hara
June 10, 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@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
June 10, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10319


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-06-09 22:39:08 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2158

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 10, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10319



--- Comment #2 from github-bugzilla@puremagic.com 2013-06-10 02:20:46 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/40d45c60ab0a01dcfdfefa80171dfbf3ae6501ec fix Issue 10319 - @safe/pure/nothrow error should print fully qualified name

https://github.com/D-Programming-Language/dmd/commit/da5dd835e09dead25933ac118cd0ba71167561df Merge pull request #2158 from 9rnsr/fix10319

Issue 10319 - @safe/pure/nothrow error should print fully qualified name

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 10, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10319


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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