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


% 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.

This works in 2.065.0 also:

void main() {
    auto e = Vec4(5);

    // 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) {

    this(float h) {}

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

remove the "string components" parameter form opDispatch to reveal the same error.

Reply via email to