digitalmars.D - Current UFCS diagnostic problem
- bearophile (18/18) Mar 27 2013 Currently there is a significant problem with UFCS usage, visible
- Jacob Carlborg (6/21) Mar 27 2013 If think I've seen something similar. When there's an ambiguous function...
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
Mar 27 2013
On 2013-03-27 15:50, bearophile wrote: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.If think I've seen something similar. When there's an ambiguous function call it will give the same error as above instead of giving an error about ambiguity. -- /Jacob Carlborg
Mar 27 2013