-
-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7981 from WalterBright/fix16037
fix Issue 16037 - assigning delegate to a scope variable shouldn't al…
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* REQUIRED_ARGS: -dip1000 | ||
| */ | ||
|
|
||
| // https://issues.dlang.org/show_bug.cgi?id=16037 | ||
|
|
||
| @safe: | ||
|
|
||
| void testXXX () @nogc | ||
| { | ||
| Object o; | ||
| scope bool delegate (Object) alwaysFalse = (Object y) { return false; }; | ||
| scope c1 = o !is null ? (Object y) { return o is y; } : alwaysFalse; | ||
| } | ||
|
|
||
| auto f() @nogc | ||
| { | ||
| int a; | ||
| void g(){ a=1; } | ||
| scope h=&g; | ||
| h(); | ||
| } | ||
|
|
||
|
|
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