[Issue 23669] New: [DIP1000] Compound assignment to length of slice member variable in scope method fails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 4 04:59:37 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23669
Issue ID: 23669
Summary: [DIP1000] Compound assignment to length of slice
member variable in scope method fails
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.102.0, the following program fails to compile:
---
struct S
{
string[] a;
@safe void reserve() scope
{
a.length += 1; // error
}
}
---
The error message is
---
bug.d(6): Error: cannot take address of `scope` variable `this` since `scope`
applies to first indirection only
---
This error is both wrong and spurious: the address of `this` is not taken, and
the program should compile successfully.
--
More information about the Digitalmars-d-bugs
mailing list