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