Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 17795 - [scope] Scope errors not detected in ~= operation
- Loading branch information
1 parent
d5ca680
commit ac2fb19
Showing
3 changed files
with
39 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
REQUIRED_ARGS: -dip1000 | ||
PERMUTE_ARGS: | ||
*/ | ||
|
||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/retscope6.d(6007): Error: reference to local variable `i` assigned to non-scope `arr[0]` | ||
--- | ||
*/ | ||
|
||
#line 6000 | ||
|
||
// https://issues.dlang.org/show_bug.cgi?id=17795 | ||
|
||
int* test() @safe | ||
{ | ||
int i; | ||
int*[][] arr = new int*[][](1); | ||
arr[0] ~= &i; | ||
return arr[0][0]; | ||
} |