Bug 18620 – `error cannot be interpreted at compile time` is missing context where error occurs
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2018-03-15T21:44:06Z
Last change time
2018-07-16T14:10:21Z
Assigned to
RazvanN
Creator
Timothee Cour
Comments
Comment #0 by timothee.cour2 — 2018-03-15T21:44:06Z
```
--- main.d
class A{
this(const(char)* s)
{
import core.stdc.string;
auto a=strlen(s);
}
}
void main(){
// likewise with __gshared
static auto a = new A("a");
}
```
main.d(5): Error: strlen cannot be interpreted at compile time, because it has no available source code
it should show where it's instantiated (ie line with `static auto a = new A("a");`) otherwise it can be really hard to figure out what caused it in complex scenarios
Comment #1 by razvan.nitu1305 — 2018-03-18T11:27:12Z