Issue 21854 - @live breaks foreach over integers
Summary: @live breaks foreach over integers
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Windows
: P3 normal
Assignee: No Owner
URL:
Keywords: live, pull
Depends on:
Blocks:
 
Reported: 2021-04-23 14:30 UTC by mhh
Modified: 2024-04-09 06:39 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mhh 2021-04-23 14:30:52 UTC
@live void glorifiedNop()
{
    foreach(int tmp; 0..10)
    {
    
    }
}

run with -preview=dip1021

https://run.dlang.io/is/zGpg3C
Comment 1 mhh 2021-04-23 14:31:17 UTC
Error: variable onlineapp.glorifiedNop.tmp is both Undefined and Owner
Comment 2 Nick Treleaven 2023-01-28 15:32:58 UTC
Confirmed with v2.101.0.
Comment 3 Walter Bright 2024-04-09 04:40:37 UTC
The trouble here appears to be that I thought I could get away with just gen vectors, but the DFA needs kill vectors, too.
Comment 4 Dlang Bot 2024-04-09 05:13:19 UTC
@WalterBright created dlang/dmd pull request #16367 "fix bugzilla Issue 21854 - @live breaks foreach over integers" fixing this issue:

- fix bugzilla Issue 21854 - @live breaks foreach over integers

https://github.com/dlang/dmd/pull/16367
Comment 5 Dlang Bot 2024-04-09 06:39:01 UTC
dlang/dmd pull request #16367 "fix bugzilla Issue 21854 - @live breaks foreach over integers" was merged into master:

- d32f565093a4ec9bc9a7b92b23416b0df586d353 by Walter Bright:
  fix bugzilla Issue 21854 - @live breaks foreach over integers

https://github.com/dlang/dmd/pull/16367