m1.d:
import m2;
struct S {
void visit() {
D!({});
}
}
m2.d:
class A {
}
class B {
A[] as;
}
import std.algorithm;
struct C(alias handler) {
void visit() {
E!handler.visit();
}
void visit() {
E!handler.visit();
}
}
struct D(alias handler) {
void resolve(B b) {
b.as.map!((a) {
C!h.visit();
});
}
}
void h()() {
}
struct E(alias handler) {
A a;
alias a this;
alias Ret = typeof(null);
Ret visit() {
}
}
$ dmd -c m1.d
[...]
dmd: aliasthis.c:96: virtual void AliasThis::semantic(Scope*): Assertion `ad2->type == Type::terror' failed.
Abandon
I haven't been able to come up with a reasonably small piece of code that trigger the assert fail without containing other errors. And may be the much larger code also contains errors, but the assert kicks in before these errors are visible ?
Also, since when dmd has become passive aggressive ? Failing because something is not an error ? Has type checking become so scary that we have type terror ?
Comment #1 by razvan.nitu1305 — 2018-11-02T10:42:43Z
Running the code does not yield an ICE anymore on git HEAD. The compilation results in correctly reported error messages. Closing as WORKSFORME.