www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18539] New: approxEqual cannot deduces type if Nullable used

https://issues.dlang.org/show_bug.cgi?id=18539

          Issue ID: 18539
           Summary: approxEqual cannot deduces type if Nullable used
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: drug2004 bk.ru

```
import std.stdio, std.typecons, std.math;
void main()
{
    auto foo = nullable(2.0);
    auto bar = nullable(2.0);

    assert (foo.approxEqual(bar));
}
```
stops compiling since 2.078, workaround is using nullable.get:
```
    assert (foo.get.approxEqual(bar.get));
```

--
Feb 28 2018