Bug 8645 – ICE: Assertion failed: (0), function totym, file glue.c, line 1150.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-12T07:57:00Z
Last change time
2012-11-14T21:25:34Z
Keywords
ice, pull
Assigned to
nobody
Creator
gileadis

Attachments

IDFilenameSummaryContent-TypeSize
1144mocked.dCode that reveals the bug.application/octet-stream402

Comments

Comment #0 by gileadis — 2012-09-12T07:57:04Z
I'm getting an ICE with the attached code (reduced by the amazing DustMite). It has to do with building a delegate literal. I'm working on building a mock objects framework inspired by Mockito. DustMite reduced the code enough that it's a bit nonsensical in the attachment, but it does reveal the error. Found in DMD 2.060 on Mac OSX Mountain Lion.
Comment #1 by gileadis — 2012-09-12T07:57:48Z
Created attachment 1144 Code that reveals the bug.
Comment #2 by bearophile_hugs — 2012-09-12T09:29:42Z
Further manual reduction: template TypeTuple(TList...) { alias TList TypeTuple; } void main() { alias TypeTuple!(int) Foo; int bar; Foo args = cast(Foo)bar; }
Comment #3 by k.hara.pg — 2012-09-16T05:08:55Z
https://github.com/D-Programming-Language/dmd/pull/1120 Current dmd doesn't detect invalid casting in front-end. I think this is one of the big issue.
Comment #4 by github-bugzilla — 2012-09-17T06:45:25Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2da26af56e702bf595b7b42e3a464ebf0016d7b9 fix Issue 8645 - ICE: Assertion failed: (0), function totym, file glue.c, line 1150. https://github.com/D-Programming-Language/dmd/commit/da5bba672eaf0d9aa224aeabe524336f4e3e9e16 Merge pull request #1120 from 9rnsr/fix8645 Issue 8645 - ICE: Assertion failed: (0), function totym, file glue.c, line 1150.