Bug 9453 – ice(symbol.c) with slice on temporary

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-05T10:06:00Z
Last change time
2013-02-05T21:34:43Z
Keywords
ice, pull, rejects-valid
Assigned to
nobody
Creator
matthias.dondorff
See also
http://d.puremagic.com/issues/show_bug.cgi?id=9209

Comments

Comment #0 by matthias.dondorff — 2013-02-05T10:06:50Z
import std.string; struct Foo { this(string bar) { } Foo opSlice(size_t start, size_t end) const { return Foo(); } size_t opDollar(int dim)() const if(dim == 0) { return 1; } } int main(string[] ) { auto b = Foo("bar")[0..$]; return 0; } DMD 2.061 produces Internal error: ..\ztc\symbol.c 1025 Could be related to #9209.
Comment #1 by k.hara.pg — 2013-02-05T20:04:40Z
Indexing has same problem. struct Foo { this(string bar) {} Foo opIndex(size_t index) const { return Foo(); } size_t opDollar(int dim)() const if(dim == 0) { return 1; } } int main(string[] ) { auto b = Foo("bar")[$-1]; return 0; } Pull request: https://github.com/D-Programming-Language/dmd/pull/1627
Comment #2 by github-bugzilla — 2013-02-05T21:31:36Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6e2f1ec1abfacf61f9f156ccf5b814a3f6e26591 fix Issue 9453 - ice(symbol.c) with slice on temporary https://github.com/D-Programming-Language/dmd/commit/d9b239775639c414d1ba94cacb352dc724650c3c Merge pull request #1627 from 9rnsr/fix9453 Issue 9453 - ice(symbol.c) with slice on temporary