mirror of
https://github.com/dlang/dmd.git
synced 2025-04-29 06:30:10 +03:00
fix Issue 21197 - Wrong lifetime inference with DIP1000 in dmd 2.093.0 (#14360)
This commit is contained in:
parent
22d5166dca
commit
84fb2c410d
2 changed files with 26 additions and 1 deletions
25
compiler/test/compilable/test21197.d
Normal file
25
compiler/test/compilable/test21197.d
Normal file
|
@ -0,0 +1,25 @@
|
|||
/* REQUIRED_ARGS: -preview=dip1000
|
||||
*/
|
||||
// https://issues.dlang.org/show_bug.cgi?id=21197
|
||||
|
||||
@safe void check2()
|
||||
{
|
||||
int random;
|
||||
|
||||
S create1() return scope {
|
||||
return S();
|
||||
}
|
||||
|
||||
scope S gen1 = create1;
|
||||
|
||||
S create2() {
|
||||
return S(&random);
|
||||
}
|
||||
|
||||
scope S gen2 = create2;
|
||||
}
|
||||
|
||||
struct S
|
||||
{
|
||||
int* r;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue