Skip to content

Nullable's toHash needs to infer its attributes #10809

Open
@jmdavis

Description

@jmdavis

It looks like someone figured out that hashOf wasn't @safe when dealing with unions with overlapping fields, so it has a deprecation message when using in code marked as @safe which won't be @safe once the deprecation is switched to an error. And with such a type, Nullable's toHash cannot be @safe, but it's currently explicitly marked as @safe. So, Nullable's toHash needs to be fixed so that it infers @safe rather than being explicitly marked with it.

void main()
{
    import std.typecons;

    static struct S
    {
        union
        {
            long foo;
            int[] bar;
        }
    }

    Nullable!S s;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions