Skip to content

Instantly share code, notes, and snippets.

@rubber-duck
Created May 14, 2013 09:10
Show Gist options
  • Save rubber-duck/5574688 to your computer and use it in GitHub Desktop.
Save rubber-duck/5574688 to your computer and use it in GitHub Desktop.
import std.stdio;
class Foo
{
void foo() { writeln("foo1"); }
void foo() { writeln("foo2"); }
void bar() { writeln("bar"); }
};
int main()
{
auto f = new Foo();
f.bar();
return 0;
}
dmd test.d
test.o: In function `_D4test3Foo3fooMFZv':
test.d:(.text._D4test3Foo3fooMFZv+0x60): multiple definition of `_D4test3Foo3fooMFZv'
test.o:test.d:(.text._D4test3Foo3fooMFZv+0x0): first defined here
collect2: error: ld returned 1 exit status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment