Bug 10319 – @safe/pure/nothrow error should print fully qualified name

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-09T22:32:00Z
Last change time
2013-06-10T02:25:55Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-06-09T22:32:31Z
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
Comment #1 by k.hara.pg — 2013-06-09T22:39:08Z
Comment #2 by github-bugzilla — 2013-06-10T02:20:46Z
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