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 #2548 from 9rnsr/fix10666
Partial fix for Issue 10666 - Appender does not work with a RefCounted type
- Loading branch information
Showing
3 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// REQUIRED_ARGS: -c | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail10666.d(16): Error: variable fail10666.foo10666.s1 has scoped destruction, cannot build closure | ||
--- | ||
*/ | ||
|
||
|
||
struct S10666 | ||
{ | ||
int val; | ||
~this() {} | ||
} | ||
|
||
void foo10666(S10666 s1) | ||
{ | ||
auto f1 = (){ return () => s1.val; }(); // NG | ||
|
||
S10666 s2; | ||
auto f2 = (){ return () => s2.val; }(); // (should be NG) | ||
} |
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