--- Comment #3 from Lars T. Kyllingstad <> 2009-12-11 
03:37:30 PST ---
I will would like to say though, that it shouldn't be possible to declare
functions like this in D. With the module system, I can't see any practical way
of defining a function in a separate .d file, as its name will be mangled with
the module name. Here's an example:

   import std.stdio;
   void print(int i) { writeln(i); }

  void print(int);
  void main() { print(123); }

$ dmd -c x.d
$ dmd y.d x.o
y.o: In function `_Dmain':
y.d:(.text._Dmain+0x9): undefined reference to `_D1y5printFiZv'
collect2: ld returned 1 exit status
--- errorlevel 1

The declaration in y.d is mangled as _D1y5printFiZv, which means y.print(int),
while the object file will contain _D1x5printFiZv, or x.print(int).


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

Reply via email to