Bug 19082 – Cannot inline "...Slides.numberOfFullFrames", "...Slides.gap"

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-07-13T13:56:00Z
Last change time
2018-08-07T15:36:24Z
Assigned to
No Owner
Creator
Mitu

Comments

Comment #0 by the.mail.of.mi2 — 2018-07-13T13:56:00Z
During dub release build I get the following errors: /usr/include/dmd/phobos/std/range/package.d(8594,24): Error: function `std.range.Slides!(cast(Flag)false, MapResult!(__lambda5, immutable(ulong)[])).Slides.numberOfFullFrames` cannot inline function /usr/include/dmd/phobos/std/range/package.d(8547,24): Error: function `std.range.Slides!(cast(Flag)false, MapResult!(__lambda5, immutable(ulong)[])).Slides.gap` cannot inline function Unfortunately I cannot provide simpler example - simple sliding numeric array worked.
Comment #1 by greensunny12 — 2018-07-14T12:50:23Z
We would need a minimal reproducible example to help you :/
Comment #2 by the.mail.of.mi2 — 2018-07-16T08:15:59Z
OK, I managed to find a minimal example. The code below builds properly for debug build, but fails with the release build. ================================= /+ dub.sdl: name "main" +/ import std.algorithm; import std.range; void main() { [1].map!(x => x).slide(2); } =========== Replacing .map!(x => x) with .map!"a" makes the code code work strangely.
Comment #3 by the.mail.of.mi2 — 2018-07-16T08:18:27Z
OK, I managed to find a minimal example. The code below builds properly for debug build, but fails with the release build. ================================== /+ dub.sdl: name "main" +/ import std.algorithm; import std.range; void main() { [1].map!(x => x).slide(2); } ================================== Replacing .map!(x => x) with .map!"a" makes the code code work strangely.
Comment #4 by greeenify — 2018-07-16T11:42:08Z
I'm sorry, but I can't reproduce this: https://run.dlang.io/is/W8BEnJ https://run.dlang.io/is/mHxy3W Have you tried DustMite?
Comment #5 by the.mail.of.mi2 — 2018-07-17T11:35:22Z
(In reply to Seb from comment #4) > I'm sorry, but I can't reproduce this: > > https://run.dlang.io/is/W8BEnJ > https://run.dlang.io/is/mHxy3W > > Have you tried DustMite? You seem to have forgotten that dub release build insterts -inline. Try this: https://run.dlang.io/is/acZVMa
Comment #6 by greeenify — 2018-07-17T14:41:39Z
Oh I see. This should fix it: https://github.com/dlang/phobos/pull/6636
Comment #7 by github-bugzilla — 2018-08-07T15:36:23Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/fc2a1d0e110d3dd422d4e10262b74774fa93fcc1 Fix Issue 19082 - Cannot inline "...Slides.numberOfFullFrames", "...Slides.gap" https://github.com/dlang/phobos/commit/a6e53eaa98fe539acdefb7d3cfed982bb0fc2bed Merge pull request #6636 from wilzbach/fix-19082 Fix Issue 19082 - Cannot inline "...Slides.numberOfFullFrames", "...Slides.gap"