https://issues.dlang.org/show_bug.cgi?id=16043
Issue ID: 16043
Summary: Wrong line number for closure in -vgc
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The following code:
```
void test () // L1
{
string[] foo;
auto f = () { assert(foo[0] == "HellO"); }; // L4
foo ~= "HellO"; // L5
}
```
Compiled with `dmd -c -vgc test.d` gives the following output:
```
test.d(5): vgc: operator ~= may cause GC allocation
test.d(1): vgc: using closure causes GC allocation
```
So the appending has the right line, but not the closure allocation.
--