On Friday, 5 April 2019 at 22:08:50 UTC, Adam D. Ruppe wrote:
Weird combination of cases that maybe should be illegal.
It errors with the highly descriptive errormessage:
app.obj(app)
Error 42: Symbol Undefined __D8mymodule3BarFZ3fooMFZCQx3Foo
Error: linker exited with status 1
On Friday, 5 April 2019 at 21:59:35 UTC, Sjoerd Nijboer wrote:
Foo Bar()
{
Foo foo();
It looks like the compiler is treating that as a function
prototype without a body (that just happens to be nested in
another function).
return foo;
And then, this foo is given the
module mymodule;
class Foo{}
Foo Bar()
{
Foo foo();
return foo;
}
int main()
{
auto foo = Bar();
return 0;
}
This code doesn't compile with a linker error that there's a
missing symbol for `Foo Bar()` on windows.
After all, `Foo foo();` isn't legitimate