Bug 20820 – [ob][DIP1021]Borrowing by a scope variable is not equivalent to a scope argument

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2020-05-11T12:38:12Z
Last change time
2024-12-13T19:08:34Z
Keywords
live
Assigned to
No Owner
Creator
lempiji
Moved to GitHub: dmd#19703 →

Comments

Comment #0 by lempiji — 2020-05-11T12:38:12Z
Would it be appropriate for the following two to behave differently? I think both should be NG for the same reasons. https://run.dlang.io/is/X7Xf8l ``` import std; import core.stdc.stdlib; void main() @live { auto p = cast(byte*) malloc(10); scope(exit) free(p); scope ps = p[0 .. 10]; writeln(ps); // NG //writelns(ps); // OK } void writelns(Args)(scope Args args...) { writeln(args); } ```
Comment #1 by robert.schadek — 2024-12-13T19:08:34Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19703 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB