Seems like this is a CTFE-only issue?

import std.stdio;
struct A
{
        int store;

        this(int a)
        {
                store = a << 3;
                //...
        }
}

A a = 5; // Error: cannot implicitly convert expression (5) of type int to A

void main()
{
        A a = 5; // fine
        writeln(a.store); // prints 40
}

Reply via email to