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
Comment #2 by github-bugzilla — 2018-07-16T14:10:20Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/304850d8810f937360a0c1391cb278248cb28f4f Fix Issue 18620 - error cannot be interpreted at compile time is missing context where error ocurrs https://github.com/dlang/dmd/commit/1e73e07467beff5bd48abe0df69e66135e2f9fd2 Fix Issue 18620 - error cannot be interpreted at compile time is missing context where error occurs https://github.com/dlang/dmd/commit/4cc487f1edb3ed1e91ec94c98407384d3e372ae8 Merge pull request #8049 from RazvanN7/Issue_18620 Fix Issue 18620 - error cannot be interpreted at compile time is missing context where error occurs