March 27, 2013 Current UFCS diagnostic problem | ||||
---|---|---|---|---|
| ||||
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 |
March 27, 2013 Re: Current UFCS diagnostic problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | 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 |
Copyright © 1999-2021 by the D Language Foundation