October 14, 2010 Overloading Generic and non-generic functions | ||||
---|---|---|---|---|
| ||||
AFAIK the following should be allowed, but it's not (v2.048): void test(uint) { } void test(T)(T value) { } void main() { test(42); test("hello"); } These end up conflicting with each other. From what I've read in TDPL we should be able to overload generic and nongeneric functions, there's an example in the book similar to this one, but it doesn't work. Has this been filed as a bug already? |
October 14, 2010 Re: Overloading Generic and non-generic functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | Andrej Mitrovic <none@none.com> wrote: > AFAIK the following should be allowed, but it's not (v2.048): > > void test(uint) { } > > void test(T)(T value) { } > > void main() > { > test(42); > test("hello"); > } > > These end up conflicting with each other. From what I've read in TDPL we should be able to overload generic and nongeneric functions, there's an example in the book similar to this one, but it doesn't work. Has this been filed as a bug already? http://d.puremagic.com/issues/show_bug.cgi?id=2972 -- Simen |
Copyright © 1999-2021 by the D Language Foundation