Bug 11850 – [ICE] Problem with filter with signed-unsigned array comparison

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-30T20:10:00Z
Last change time
2014-01-12T17:38:57Z
Keywords
ice, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-12-30T20:10:57Z
import std.algorithm: filter; void main() { filter!(a => a < [0])([[0u]]); } DMD 2.065alpha gives the errors and then crashes: temp.d(3): Error: incompatible types for ((a) < ([0])): 'uint[]' and 'int[]' ...\dmd2\src\phobos\std\algorithm.d(1396): instantiated from here: FilterResult!(__lambda1, uint[][]) temp.d(3): instantiated from here: filter!(uint[][]) temp.d(3): Error: template instance temp.main.filter!((a) => a < [0]).filter!(uint[][]) error instantiating
Comment #1 by k.hara.pg — 2013-12-31T02:13:14Z
Comment #2 by bearophile_hugs — 2014-01-04T16:20:40Z
Perhaps this is the same bug: void main() { import std.algorithm: map, filter; [[1]].filter!(a => a.map!q(x => x)); } temp.d(3): Error: undefined identifier q ...\dmd2\src\phobos\std\algorithm.d(1396): instantiated from here: FilterResult!(__lambda1, int[][]) temp.d(3): instantiated from here: filter!(int[][]) temp.d(3): Error: template instance temp.main.filter!((a) => a.map!q((x) => x)).filter!(int[][]) error instantiating
Comment #3 by k.hara.pg — 2014-01-12T17:38:57Z