Summary: Forward declaration and implementation allowed in same
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Manu <> 2012-05-16 01:12:35 PDT ---
Currently, forward declaration is allowed, but it is presumed it is used to
describe an extern function.
I generate a lot of function implementations using magic, and I'd really like
to describe them using the natural forward declaration rather than an ugly
mixin template.

// declare external interface
void test();
void another(int x);

// generate bindings
mixin RegisterModule; // this produces code that scans the module for functions
and generates their bodies

This compiles, but when trying to call any such function, it produces the
Error: function remedy.engine.debugdraw.test called with argument types:
matches both:

One of which is the forward declaration.
I think the forward declaration should silently yield the symbol to the actual
function definition.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to