Weird dmd error?
Anonymous via Digitalmars-d
digitalmars-d at puremagic.com
Mon Nov 7 01:58:08 PST 2016
On Monday, 7 November 2016 at 08:34:55 UTC, Andrea Fontana wrote:
>
> --- test.d
> void* test (ssize_t );
> import core.sys.posix.unistd;
> ---
>
> Try to run:
> dmd test.d
>
> It says:
> /usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(100): Error: undefined identifier 'c_long'
It looks normal but it's not documented. It's just that the
import is not yet known in the scope. It 's like:
void main(string[] args)
{
writeln();
import std.stdio;
}
But
void main(string[] args)
{
writeln();
}
import std.stdio;
works because the symbol lookup succeeds in the parent scope.
For your example to work, another semantic pass would necessary.
More information about the Digitalmars-d
mailing list