Bug 11297 – [ICE](glue.c line 868) with a string concat in global enum lambda

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-18T18:44:00Z
Last change time
2013-11-11T21:20:20Z
Keywords
ice, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-10-18T18:44:52Z
import std.algorithm: map, reduce; import std.array: array; enum foo = (string[] arr, string x) => arr.map!(y => "" ~ x).array; void main() { reduce!foo([""], [""]); } dmd 2.064beta2 crashes with: Assertion failure: '!v->csym' on line 868 in file 'glue.c'
Comment #1 by bugzilla — 2013-11-11T10:51:59Z
A reduced example: ------------- void xmap(alias g)(int t) { g(t); } enum foo = function (int x) { // int bar(int y) { return x; } xmap!bar(7); // works xmap!(y => x)(7); // fails }; void xreduce(alias f)() { f(4); } --------------
Comment #2 by bugzilla — 2013-11-11T18:49:56Z
Comment #3 by github-bugzilla — 2013-11-11T21:19:45Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6706e41e179c74922ec4e06fc74a8816e794d47b fix Issue 11297 - [ICE](glue.c line 868) with a string concat in global enum lambda https://github.com/D-Programming-Language/dmd/commit/9c3d79402c38559523f9702be8aa300799b5021c Merge pull request #2745 from WalterBright/fix11297b fix Issue 11297 - [ICE](glue.c line 868) with a string concat in global enum lambda