Bug 12501 – Assertion `global.gaggedErrors || global.errors' failed.

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-31T16:42:00Z
Last change time
2014-04-15T07:22:14Z
Keywords
ice, pull
Assigned to
nobody
Creator
acehreli

Comments

Comment #0 by acehreli — 2014-03-31T16:42:11Z
The following program causes an assertion failure in statement.c with current it head: DMD64 D Compiler v2.066-devel-75159e4 import std.algorithm; int foo(int value) { return value; } void main() { reduce!(foo, foo)(tuple(0, 0), [ 1 ]); } statement.c:274: ErrorStatement::ErrorStatement(): Assertion `global.gaggedErrors || global.errors' failed.
Comment #1 by k.hara.pg — 2014-03-31T23:39:29Z
Comment #2 by github-bugzilla — 2014-04-01T03:35:56Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/99ec02c619d4a6358b2dcf04f9b88c02d2191b9a fix Issue 12501 - Assertion `global.gaggedErrors || global.errors' failed. https://github.com/D-Programming-Language/dmd/commit/f92062c8c496269720ad911dbc2bf04d24a0dbc4 Merge pull request #3414 from 9rnsr/fix12501 [REG2.066a] Issue 12501 - Assertion `global.gaggedErrors || global.errors' failed.
Comment #3 by k.hara.pg — 2014-04-04T05:51:42Z
*** Issue 12517 has been marked as a duplicate of this issue. ***
Comment #4 by monarchdodra — 2014-04-13T19:18:52Z
Was this fixed? I can reproduce it with this case: //---- void main() { import std.algorithm: min, max, reduce; import std.typecons: tuple; dchar c = 'a'; reduce!(min, max)(tuple(c, c, c), "hello"); // OK } //---- dmd: statement.c:713: ErrorStatement::ErrorStatement(): Assertion `global.gaggedErrors || global.errors' failed. Aborted (core dumped) //---- Or, reduced to: //---- import std.traits, std.functional; template reduce(fun...) { auto reduce(Seed)(Seed result) { foreach (i, Unused; Seed.Types) result[i] = binaryFun!(fun[i])(1, 1); //Here return result; } } void main() { import std.typecons: tuple; reduce!("a", "a")(tuple(1, 1, 1)); } //---- I think the root issue is in: result[i] = binaryFun!(fun[i])(1, 1); //Here Changing to either: auto a = binaryFun!(fun[i])(1, 1); or result[i] = fun[i](1, 1); Allows it to "fail correctly" ... Or is it a different issue?
Comment #5 by monarchdodra — 2014-04-13T19:32:52Z
(In reply to monarchdodra from comment #4) > Was this fixed? I can reproduce it with this case: Bearophile filed at as its own issue: https://issues.dlang.org/show_bug.cgi?id=12569 Don't know which you'd rather close (eg: deplicate, or leave this as fixed).
Comment #6 by monarchdodra — 2014-04-13T19:33:59Z
(In reply to monarchdodra from comment #4) > Was this fixed? I can reproduce it with this case: Bearophile filed at as its own issue: https://issues.dlang.org/show_bug.cgi?id=12574 Don't know which you'd rather close (eg: deplicate, or leave this as fixed).
Comment #7 by k.hara.pg — 2014-04-15T07:22:14Z
(In reply to monarchdodra from comment #6) > (In reply to monarchdodra from comment #4) > > Was this fixed? I can reproduce it with this case: > > Bearophile filed at as its own issue: > https://issues.dlang.org/show_bug.cgi?id=12574 > > Don't know which you'd rather close (eg: deplicate, or leave this as fixed). I opened new compiler PR to fix issue 12574.