Bug 17988 – [ICE] Segfault when using member in map

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-11-17T13:25:13Z
Last change time
2018-03-18T15:55:33Z
Assigned to
No Owner
Creator
Christian DurĂ¡n

Comments

Comment #0 by ovejacuantica — 2017-11-17T13:25:13Z
import std.stdio, std.range, std.algorithm; void main (string [] args) { int [][] s; auto q = s.front.front; s.map!(c => c.map!(a => text(a[0] / q))); } Tested with dmd 2.077.0, ldc 1.5.0 doesn't segfault.
Comment #1 by bitter.taste — 2018-03-18T15:55:33Z
Works in master w/ the following output: --- /tmp/foo.d(5): Error: only one index allowed to index int ./generated/linux/release/64/../../../../../phobos/std/algorithm/iteration.d(497): instantiated from here: MapResult!(__lambda2, int[]) /tmp/foo.d(5): instantiated from here: map!(int[]) ./generated/linux/release/64/../../../../../phobos/std/algorithm/iteration.d(602): instantiated from here: __lambda2!(int[]) ./generated/linux/release/64/../../../../../phobos/std/algorithm/iteration.d(497): instantiated from here: MapResult!(__lambda2, int[][]) /tmp/foo.d(5): instantiated from here: map!(int[][]) ---