D-Scanner icon indicating copy to clipboard operation
D-Scanner copied to clipboard

Warnings with the shift operator

Open Luhrel opened this issue 5 years ago • 0 comments

The code:

    void main()
    {
        const Foo foo;
        bool bl;
        foo >> bl;
    }

    struct Foo
    {
        bool bar = true;

        void opBinary(string op)(out bool value) if (op == ">>")
        {
            value = bar;
        }
    }

Give the following warnings:

Variable foo is never used. Variable bl is never modified and could have been declared const or immutable. Variable bl is never used.

Luhrel avatar Feb 12 '20 14:02 Luhrel