On Monday, 29 June 2020 at 06:21:43 UTC, ag0aep6g wrote:
Since `local` and `writeln` are templates, the attributes for
their parameters are inferred from their bodies. `local!(int*)`
doesn't do anything with the parameter, so it's inferred as
`scope`. `writeln!(int*)` apparently does something
On 29.06.20 02:28, Stanislav Blinov wrote:
void local(Args...)(Args args)
{
}
void main() @safe
{
import std.stdio;
scope int* p;
local(p); // Ok
writeln(p); // Error: scope variable p assigned to non-scope
parameter _param_0 calling std.stdio.writeln!(int*).writeln
}
Th
void local(Args...)(Args args)
{
}
void main() @safe
{
import std.stdio;
scope int* p;
local(p); // Ok
writeln(p); // Error: scope variable p assigned to non-scope
parameter _param_0 calling std.stdio.writeln!(int*).writeln
}
The signatures of `std.stdio.writeln` and `local`