← Back to index
|
Original Bugzilla link
Bug 12838 – Dmd show ICEs when using Tuple and wrong type
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-01T23:11:00Z
Last change time
2014-06-05T21:40:39Z
Keywords
ice, pull
Assigned to
nobody
Creator
bioinfornatics
Comments
Comment #0
by bioinfornatics — 2014-06-01T23:11:01Z
------------ CODE import std.typecons : Tuple; struct Data { string a; } template toTuple(T){ static string maker(){ string statement = "alias toTuple = Tuple!("; foreach(const memberName; __traits(allMembers, T)) statement ~= typeof(__traits(getMember, T, memberName)).stringof ~ ",\"" ~ memberName ~ "\", " ; statement = statement[0..$-2] ~ ") ;" ; // $-2 to remove extra comma return statement; } mixin( maker() ); } void main() { alias A = toTuple!Data; A a; a[0] = 1; a.x = 1; } ------------ $ LD_LIBRARY_PATH=/opt/dmd/lib/ /opt/dmd/bin/dmd testBug.d dmd: statement.c:714: ErrorStatement::ErrorStatement(): Assertion `global.gaggedErrors || global.errors' failed. Abandon (core dumped) ------------ a[0] expect a string but here intentionnaly i provide a int to show a dmd bug
Comment #1
by k.hara.pg — 2014-06-03T10:06:49Z
https://github.com/D-Programming-Language/dmd/pull/3617
Comment #2
by github-bugzilla — 2014-06-05T21:40:38Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/9dde636364f8e13a2479feb523d1c880fbefb237
fix Issue 12838 - Dmd show ICEs when using Tuple and wrong type
https://github.com/D-Programming-Language/dmd/commit/7be3892800a6c98c6d745854f002ea6da4a79261
Merge pull request #3617 from 9rnsr/fix12838 Issue 12838 - Dmd show ICEs when using Tuple and wrong type