[Issue 18560] find on infinite ranges is broken

2018-04-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

ag0aep6g  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #5 from ag0aep6g  ---
(In reply to ag0aep6g from comment #4)
> The codegen bug has its own dedicated issue: issue 12486.
[...]
> Ideally, the compiler bug would get fixed soon and
> then this can be closed as a duplicate.

Issue 12486 has been fixed. `assert(true.repeat.all != false);` is now an
infinite loop as expected. Closing as duplicate.

*** This issue has been marked as a duplicate of issue 12486 ***

--


[Issue 18560] find on infinite ranges is broken

2018-03-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords|wrong-code  |
  Component|dmd |phobos
   Hardware|x86_64  |All
   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=12486
 OS|Linux   |All

--- Comment #4 from ag0ae...@gmail.com ---
The codegen bug has its own dedicated issue: issue 12486.

I'm changing this to a Phobos bug. Maybe `true.repeat.all` can be made to
behave as expected by working around the compiler bug.

I'm not sure how feasible that is, though. Likely, other Phobos functions are
affected as well. Ideally, the compiler bug would get fixed soon and then this
can be closed as a duplicate. (Wishful thinking for sure.)

--


[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

Ketmar Dark  changed:

   What|Removed |Added

 CC||ket...@ketmar.no-ip.org

--


[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||wrong-code
 CC||ag0ae...@gmail.com

--- Comment #3 from ag0ae...@gmail.com ---
That makes it a codegen bug. foo isn't pure so it must be executed for the side
effects. The compiler cannot skip the execution just because the result isn't
really used.

--


[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

--- Comment #2 from FeepingCreature  ---
No, this is the actual problem!

struct Struct
{
enum Enum = 5;
}

bool fooEvaluated;

Struct foo() { fooEvaluated = true; return Struct(); }

assert(foo().Enum == 5);

assert(fooEvaluated == true);

Should this last assert pass? Right now it doesn't, because foo() is never
evaluated because Enum is enum. This means that in any and all, the find()
never runs.

--


[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

--- Comment #1 from FeepingCreature  ---
The actual problem seems to be that expression.empty actually presumes that
expression terminates. So when .all checks for find.empty, it fails to account
for the case that find does not terminate, in which situation the behavior is
logically undefined.

--


[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560

FeepingCreature  changed:

   What|Removed |Added

   Severity|enhancement |normal

--