[Bug 253] Linker error when using -O

via D.gnu d.gnu at puremagic.com
Sat Mar 4 08:33:10 PST 2017


https://bugzilla.gdcproject.org/show_bug.cgi?id=253

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Reduced test:
---
import some_class;

interface A
{
    void foo(int[int]);
}

interface C:A
{
}

class D:B,C
{
}

---

import example;

class ConvException : Exception
{
    this(string s)
    {
        super(s);
    }
}

T to(T, A)(A)
{
    throw new ConvException(null);
}

class B : A
{
    void foo(int[int] a)
    {
        if (to!int(a.get(0, 1))) return;
    }

}
---

Happens because the thunk generated in 'example.d' inlines the function call to
'B.foo'.  However that doesn't work because it calls a lambda that is not
externally visible outside of the compilation unit of 'some_class.d'.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the D.gnu mailing list