Thread overview
[Issue 17639] Implicit conversion of bool to float should be rejected
[Issue 17639] std.math.approxEqual accepts return of isNaN (bool) as argument
Jul 12, 2017
drug007
Jul 12, 2017
Simen Kjaeraas
Jul 15, 2017
Vladimir Panteleev
Dec 17, 2022
Iain Buclaw
July 12, 2017
https://issues.dlang.org/show_bug.cgi?id=17639

drug007 <drug2004@bk.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|dmd                         |phobos

--
July 12, 2017
https://issues.dlang.org/show_bug.cgi?id=17639

Simen Kjaeraas <simen.kjaras@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |simen.kjaras@gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from Simen Kjaeraas <simen.kjaras@gmail.com> ---
There's nothing particular about approxEqual in this case - at least 26 out of 70 functions in std.math accept bools for at least one of their parameters.

This bug report basically boils down to this code:

float f = false;

This compiles and is valid D. (and the value of f is 0)

--
July 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17639

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|RESOLVED                    |REOPENED
          Component|phobos                      |dmd
           Hardware|x86_64                      |All
         Resolution|INVALID                     |---
            Summary|std.math.approxEqual        |Implicit conversion of bool
                   |accepts return of isNaN     |to float should be rejected
                   |(bool) as argument          |
                 OS|Linux                       |All

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
(In reply to Simen Kjaeraas from comment #1)
> This bug report basically boils down to this code:
> 
> float f = false;

That doesn't make sense and doesn't seem useful, so let's reopen it as an accepts-invalid.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=17639

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=17639

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17805

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--