D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7827 - ICE(glue.c, !vthis->csym) delegate and type inference
Summary: ICE(glue.c, !vthis->csym) delegate and type inference
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2012-04-05 02:34 UTC by Jacob Carlborg
Modified: 2013-10-07 13:36 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2012-04-05 02:34:43 UTC
When I try to use a delegate as template parameter and type inference DMD asserts with this message:

Assertion failed: (!vthis->csym), function toObjFile, file glue.c, line 686.

https://github.com/D-Programming-Language/dmd/blob/master/src/glue.c#L686

I haven't been able to find a reduced test case but this is the code that fails:

https://github.com/jacob-carlborg/phobos/blob/terminal/std/event.d#L113

If I changed that line to:

eventHandlers = .remove!((e) { return e == eventHandler; })(eventHandlers);

Or

eventHandlers = .remove!(e => e == eventHandler)(eventHandlers);

The assert is triggered. I'm using:

DMD: b41a2c360f09b83e4de6951f1e7538372319704f
Druntime: b41a2c360f09b83e4de6951f1e7538372319704f
Phobos: b93e9c9fd47fe309bb422408cbedc5897d87c368

I'm compiling on Mac OS X for 32bit.
Comment 1 Don 2012-04-05 03:26:46 UTC
This is probably a duplicate of bug 4129.
Two others which ICE at the same place are bug 6896 and bug 4481.
Comment 2 Walter Bright 2013-10-06 22:18:42 UTC
Jacob - since 4481 and 6896 appear to be fixed, and 4129 is D1 only, can you see if this still is a problem here?
Comment 3 Jacob Carlborg 2013-10-07 00:49:58 UTC
(In reply to comment #2)
> Jacob - since 4481 and 6896 appear to be fixed, and 4129 is D1 only, can you
> see if this still is a problem here?

I cannot reproduce this error anymore.
Comment 4 Walter Bright 2013-10-07 13:36:23 UTC
Thank you. Marking as resolved.