ref param mismatch --> segfault

bearophile bearophileHUGS at lycos.com
Mon Jan 24 15:04:32 PST 2011


spir:

> I guess this does the job?

It's not minimal and it's not complete, it misses a main and the imports :-) But it's OK.
A reduced test case shows that DMD has holes here, this compiles with no errors. I think this DMD bug is already in Bugzilla:

void foo(ref int x) {}
void bar1(void function(int) f) {}
void bar2(void function(string) f) {}
void main() {
    bar1(&foo);
    bar2(&foo);
}

Bye,
bearophile


More information about the Digitalmars-d mailing list