[Issue 13508] New: array vararg function safety not inferred
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Sep 20 06:39:01 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13508
Issue ID: 13508
Summary: array vararg function safety not inferred
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: monarchdodra at gmail.com
struct S
{
this(T)(T[] t...)
{}
}
template make(T)
{
T make(Args...)(Args args) //@safe
{
return T(args);
}
}
void main() @safe
{
S s = make!S(5);
}
//----
Error: safe function 'D main' cannot call system function
'main.make!(S).make!(int).make'
//----
If you mark "make" as explicitly safe, then it works.
Then again, I believe using "T[] t..." isn't safe to begin with...? (slice
contents are destroyed at end of scope). Either way, there's a bug in there.
--
More information about the Digitalmars-d-bugs
mailing list