Bug 18539 – [Reg 2.078.1] approxEqual cannot deduces type if Nullable used
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-28T13:38:08Z
Last change time
2018-03-07T17:35:30Z
Assigned to
No Owner
Creator
drug007
Comments
Comment #0 by drug2004 — 2018-02-28T13:38:08Z
```
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));
```
Comment #1 by greeenify — 2018-02-28T17:22:02Z
On my phone, but the issue has been fixed in stable and will be part of 2.079. Try dmd-beta.
The best course of action would be to add this unittest to Phobos to prevent this from regressing (again).