Bug 8453 – Associative array keys refused as property by sort
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-27T09:03:00Z
Last change time
2012-07-28T13:08:00Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-07-27T09:03:53Z
AA.keys is specified as property, and this program used to work in 2.059, but in dmd 2.060beta there is an error on the line of bar2:
import std.algorithm: sort;
void main() {
int[int] foo;
auto bar1 = foo.keys().sort(); // OK
auto bar2 = foo.keys.sort(); // Error
}
DMD 2.060beta gives:
temp.d(5): Error: function expected before (), not _adSort(foo.keys(),&D10TypeInfo_i6__initZ) of type int[]
...\dmd2\src\phobos\std\format.d(1460): Error: template std.algorithm.find does not match any function template declaration
...\dmd2\src\phobos\std\algorithm.d(2944): Error: template std.algorithm.find cannot deduce template function from argument types !()(string,char)
...\dmd2\src\phobos\std\format.d(2782): Error: template instance std.format.formatValue!(void delegate(const(char)[]),const(real),char) error instantiating
...\dmd2\src\phobos\std\format.d(421): instantiated from here: formatGeneric!(void delegate(const(char)[]),const(real),char)
...\dmd2\src\phobos\std\complex.d(144): instantiated from here: formattedWrite!(void delegate(const(char)[]),char,const(real))
...\dmd2\src\phobos\std\complex.d(649): instantiated from here: Complex!(real)
...\dmd2\src\phobos\std\format.d(421): Error: template instance std.format.formatGeneric!(void delegate(const(char)[]),const(real),char) error instantiating
...\dmd2\src\phobos\std\complex.d(144): instantiated from here: formattedWrite!(void delegate(const(char)[]),char,const(real))
...\dmd2\src\phobos\std\complex.d(649): instantiated from here: Complex!(real)
...\dmd2\src\phobos\std\complex.d(144): Error: template instance std.format.formattedWrite!(void delegate(const(char)[]),char,const(real)) error instantiating
...\dmd2\src\phobos\std\complex.d(649): instantiated from here: Complex!(real)