https://issues.dlang.org/show_bug.cgi?id=23985
Issue ID: 23985
Summary: [dip1000] return scope fails to infer after assignment
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
>From the newsgroup:
https://forum.dlang.org/post/[email protected]
```D
// REQUIRED_ARGS: -preview=dip1000
@safe:
struct B()
{
int* a;
C!() c;
}
class C()
{
C!() foo(int* a)
{
return foo2(a);
}
C!() foo2(int* a)
{
auto b = B!()(a);
return b.c;
}
}
void main()
{
scope int* a;
C!() c;
// Error: scope variable `a` assigned to non-scope parameter `a` calling
`foo`
c.foo(a);
}
a);
}
```
--