On 7/9/14, 4:18 PM, Bob wrote:
Hi, I hit problem with templates/opDispatch.

http://pastebin.com/rc09yWNt

% uname -a
Linux machine 3.11.0-20-generic #35-Ubuntu SMP Fri May 2 21:32:49 UTC
2014 x86_64 x86_64 x86_64 GNU/Linux

What does this event mean? Where does xyz come from? The code below also compiles in 2.065.0 on osx, but comment out opDispach() and it fails with the same error message as above.

Seems to be a bug that got fixed.

void main() {
    auto e = Vec4(5, 3, 3, 1);

    // This worked with dmd_2.065.0-0_amd64
    // but does not work with dmd_2.066.0~b2-0_amd64
    auto x = e.xyz; // Error: no property 'xyz' for type 'Vec!4'
}

alias Vec4 = Vec!4;

struct Vec(int dim) {

    union {
        struct {
            float h;
            float i;
            float j;
            static if (4 <= dim) float w;
        }
    }

    this(float h, float i, float j, float w) {}

    auto opDispatch(string components)() const {
        Vec!(1) result = void;
        return result;
    }
}

Reply via email to