Bug 13239 – Code is generated for unused lazy expressions

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-01T19:58:19Z
Last change time
2024-12-13T18:23:11Z
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#18860 →

Comments

Comment #0 by bugzilla — 2014-08-01T19:58:19Z
Given the code: --- void log(A...)(lazy A args) { } int fun(string[] args) { log("hello " ~ args[0]); return 43; } --- Code is generated for ("hello " ~ args[0]) even though it is unused. This can cause significant unwanted code bloat.
Comment #1 by andrei — 2014-08-01T20:25:23Z
Thanks! This blocks std.logger.
Comment #2 by andrei — 2014-08-01T20:25:55Z
Comment #3 by robert.schadek — 2024-12-13T18:23:11Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18860 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB