Bug 10279 – Calling a typesafe variadic @trusted function from an @safe function results in an error.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-06T00:03:00Z
Last change time
2013-06-28T06:09:20Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
tcdknutson

Comments

Comment #0 by tcdknutson — 2013-06-06T00:03:13Z
The following code will not compile, however it seems like it's valid: ulong foo(string[] strs...) @trusted { return strs.length; } void bar() @safe { foo("asdf"); } void main() {} The error "Error: variable maybebug.bar.__arrayArg4 void initializers for pointers not allowed in safe functions" will be emitted. DMD version: 2.064, Windows x64 and DMD version 2.063 on Linux x64
Comment #1 by henning — 2013-06-12T14:09:45Z
Comment #2 by github-bugzilla — 2013-06-28T05:59:46Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e78f6e7affbdb984ee5a7ecb831c5a46e9a0e738 fix issue 10279 - Calling a typesafe variadic @trusted function from an @safe function results in an error. https://github.com/D-Programming-Language/dmd/commit/e92d69e51b5ac130e6c62968996e6f524cbfe51f Merge pull request #2168 from hpohl/10279 fix issue 10279 - Calling a typesafe variadic @trusted function from an @safe function results in an error.