[Issue 18620] New: `error cannot be interpreted at compile time` is missing context where error occurs
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 15 21:44:06 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18620
Issue ID: 18620
Summary: `error cannot be interpreted at compile time` is
missing context where error occurs
Product: D
Version: D2
Hardware: x86
OS: All
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timothee.cour2 at gmail.com
```
--- 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
--
More information about the Digitalmars-d-bugs
mailing list