Bug 20888 – std.range.Cycle does not compose with `const`

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-05-31T08:59:58Z
Last change time
2024-12-13T19:08:59Z
Assigned to
No Owner
Creator
Mathias LANG
Moved to GitHub: dmd#19714 →

Comments

Comment #0 by pro.mathias.lang — 2020-05-31T08:59:58Z
``` import std.stdio; import std.range; struct Data { char[4096] internal; Cycle!(char[4096]) cycle; auto get () const { return this.cycle.save(); } } void main () { Data d; writeln(d.get().take(10)); } ``` Expectation: 10 characters get printed Reality: ``` /usr/local/opt/dmd/include/dlang/dmd/std/range/package.d(2231): Error: cannot implicitly convert expression input of type const(Cycle!(char[4096])) to Cycle!(char[4096]) foo.d(14): Error: template instance std.range.take!(const(Cycle!(char[4096]))) error instantiating ```
Comment #1 by robert.schadek — 2024-12-13T19:08:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19714 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB