← Back to index
|
Original Bugzilla link
Bug 9875 – opDispatch is wrongly set to safe
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-04T07:17:00Z
Last change time
2015-10-02T00:15:38Z
Keywords
rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0
by andrej.mitrovich — 2013-04-04T07:17:16Z
import std.string; mixin template Mixin() { auto test()() // must be template to reproduce { static struct Dispatch // move outside of 'test' and it works { void opDispatch(string name, Args...)(Args args) { assert(0, format("%s", "")); } } return Dispatch(); } } mixin Mixin!(); void main() { test().foo(); } Error: safe function 'test.Mixin!().test!().test.Dispatch.opDispatch!("foo", ).opDispatch' cannot call system function 'std.string.format!(char, string).format'
Comment #1
by andrej.mitrovich — 2013-04-04T07:19:08Z
Oh and I'm using 2.063 git-head.
Comment #2
by andrej.mitrovich — 2013-09-18T05:12:41Z
Works in 2.063.2.
Comment #3
by github-bugzilla — 2015-10-02T00:15:38Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/4eec962ad52b8267b4c3102427d0d590e28de06d
another case for Issue 9875
https://github.com/D-Programming-Language/dmd/commit/16a5792ee2df0129f063391568044ba383ffec88
Merge pull request #5150 from WalterBright/inline3 another case for Issue 9875