ldc-developers/ldc — Issue #75: "unhandled repainting of return value" with static array of consts
Author: SiegeLord
Created: 2012-02-05 06:52:12+00:00
State: open

Compiling this code:

```D
double[1] test()
{
return [1];
}

void test(const(double)[1] a)
{

}

void main()
{
test(test());
}
```

Yields this:

```
ldc2: /home/siege/src/ldc_fork/gen/tocall.cpp:651: DValue* DtoCallFunction(Loc&, Type*, DValue*, Expressions*): Assertion `0 && "unhandled repainting of return value"' failed.
0 ldc2 0x0000000000fe2abf
1 ldc2 0x0000000000fe2fc9
2 libpthread.so.0 0x00007fe36a804060
3 libc.so.6 0x00007fe3698d13a5 gsignal + 53
4 libc.so.6 0x00007fe3698d4b0b abort + 379
5 libc.so.6 0x00007fe3698c9d4d __assert_fail + 221
6 ldc2 0x00000000006ec151 DtoCallFunction(Loc&, Type*, DValue*, ArrayBase*) + 3793
7 ldc2 0x00000000006bdd8c CallExp::toElem(IRState*) + 412
8 ldc2 0x00000000006d2db7 DtoArgument(Parameter*, Expression*) + 71
9 ldc2 0x00000000006ebebd DtoCallFunction(Loc&, Type*, DValue*, ArrayBase*) + 3133
10 ldc2 0x00000000006bdd8c CallExp::toElem(IRState*) + 412
11 ldc2 0x00000000006b9f24 Expression::toElemDtor(IRState*) + 68
12 ldc2 0x0000000000686d1a ExpStatement::toIR(IRState*) + 90
13 ldc2 0x000000000068657e CompoundStatement::toIR(IRState*) + 94
Aborted
```