Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 17423 - pointer assignment to in member function is not acc…
…ounted for
- Loading branch information
1 parent
0bdfedc
commit 9fbf061
Showing
4 changed files
with
58 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* REQUIRED_ARGS: -dip1000 | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/test17423.d(26): Error: reference to local `this` assigned to non-scope parameter `dlg` calling test17423.Bar.opApply | ||
--- | ||
*/ | ||
|
||
// https://issues.dlang.org/show_bug.cgi?id=17423 | ||
|
||
struct Bar | ||
{ | ||
int delegate(int) @safe myDlg; | ||
|
||
auto opApply(int delegate(int) @safe dlg) @safe { | ||
myDlg = dlg; | ||
return 0; | ||
} | ||
} | ||
|
||
struct Foo | ||
{ | ||
Bar o; | ||
int i = 3; | ||
|
||
this(int x) @safe { | ||
foreach(_; o) { i = 0; } | ||
i = x; | ||
} | ||
} |