Current UFCS diagnostic problem

bearophile bearophileHUGS at lycos.com
Wed Mar 27 07:50:24 PDT 2013


Currently there is a significant problem with UFCS usage, visible 
in this wrong program:


import std.algorithm, std.array;

int[] foo(R)(R data) {
     return data.map!(x => y ^^ 2).array;
}

void main() {
     auto r1 = [1, 2, 3].foo;
}


The latest dmd 2.063alpha gives just the error:

test.d(8): Error: no property 'foo' for type 'int[]'


dmd keeps giving the same error for lot mutations of the code of 
foo(). When the code gets more complex, with some UFCS chains, 
debugging code becomes not easy. (This is already in Bugzilla). 
I'd like this problem to be somehow addressed before the release 
of dmd 2.063.

Bye,
bearophile


More information about the Digitalmars-d mailing list