Bug 13221 – [ICE] '0' on line 318 in file 'interpret.c'
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-28T11:26:00Z
Last change time
2014-08-22T08:05:06Z
Keywords
ice, pull
Assigned to
nobody
Creator
jblume
Comments
Comment #0 by jblume — 2014-07-28T11:26:21Z
import std.typecons;
template test(T) {}
void main()
{
foreach (r; 0 .. 0)
{
enum i = r;
test!(Tuple!bool[i]);
}
}
On v2.066.0-b6 this results in:
main.d(9): Error: variable r cannot be read at compile time
main.d(10): Error: CTFE internal error: ErrorExp in main.d(10)
Assertion failure: '0' on line 318 in file 'interpret.c'
Comment #1 by k.hara.pg — 2014-07-29T09:26:51Z
(In reply to Johannes Blume from comment #0)
> On v2.066.0-b6 this results in:
>
> main.d(9): Error: variable r cannot be read at compile time
> main.d(10): Error: CTFE internal error: ErrorExp in main.d(10)
>
> Assertion failure: '0' on line 318 in file 'interpret.c'
The ICE occurs from 2.064.
With 2.062 -> no ICE
$ dmd -o- test
test.d(9): Error: variable r cannot be read at compile time
test.d(10): Error: Integer constant expression expected instead of cast(int)r
With 2.063 -> no ICE
$ dmd -o- test
test.d(9): Error: variable r cannot be read at compile time
C:\dmd2.063\src\phobos\std\range.d(611): Error: static assert "Cannot put a char[] into a Appender!(string)"
C:\dmd2.063\src\phobos\std\format.d(1433): instantiated from here: put!(Appender!(string), char[])
C:\dmd2.063\src\phobos\std\format.d(1335): instantiated from here: formatUnsigned!(Appender!(string), char)
C:\dmd2.063\src\phobos\std\format.d(1309): instantiated from here: formatIntegral!(Appender!(string), ulong, char)
C:\dmd2.063\src\phobos\std\format.d(2950): ... (3 instantiations, -v to show) ...
C:\dmd2.063\src\phobos\std\typecons.d(326): instantiated from here: format!(char, uint, uint)
test.d(10): instantiated from here: Tuple!(bool)
With 2.064, and 2.065 -> ICE