www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24403] New: Nullable doesn't work with non-mutable types with

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

          Issue ID: 24403
           Summary: Nullable doesn't work with non-mutable types with a
                    destructor
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: issues.dlang jmdavisProg.com

This code does not compile but should:

---
void main()
{
    import std.typecons : Nullable;

    static struct S
    {
        ~this()
        {
        }
    }

    Nullable!(const S) s;
}
---

Nullable's destructor is able to handle mutable types but not const or
immutable types.

--
Feb 20