I have some code:

import std.stdio;

auto dot(T, R)(T x, R y) {
    return x * y;
}

struct Vector(T)
{
    alias selftype = Vector!T;
    int len = 5;
pure:
    const @property{
static if( is( typeof( dot( selftype.init, selftype.init ) ) ) ){
            auto len2() {return len * len;}
        }

        static if(is(typeof(T.init * T.init) == T)) {
                auto e() {return len;}
        }
    }
}


void main() {
    Vector!(float) vec;
    float x = vec.len2();
    writeln(x);
    x = vec.e();
    writeln(x);
}

I get error by compiler when i build this:
main.d(30): Error: no property 'len2' for type 'Vector!float', did you mean 'len'?

In dmd 2.067 is normaly.
is it Bug or enhancements?

Reply via email to