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)
Comment #1 by k.hara.pg — 2012-07-28T03:36:10Z
Comment #2 by github-bugzilla — 2012-07-28T11:34:04Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9ea5769d50ed4dcd085dad05a40dd013f9fd52f8 fix Issue 8453 - Associative array keys refused as property by sort This is a regression of refactoring around UFCS mechanism. Introduced commit: e9538dc00db8789ab1f686f0a0a2bed7316ee794 https://github.com/D-Programming-Language/dmd/commit/988414c6564fb4a4ab091bb63df4fbded9645be8 Merge pull request #1066 from 9rnsr/fix8453 Issue 8453 - Associative array keys refused as property by sort