April 16, 2014 [Issue 8373] IFTI fails on overloading of function vs non function template | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=8373 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid, pull --- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> --- (In reply to timon.gehr from comment #0) > DMD 2.059: > auto fun(T...)(T args){return 1;} > template fun(a...){auto fun(T...)(T args){return 2;}} > static assert(fun(0)==1); // error > > The call matches only the first declaration, therefore the overload > resolution > should succeed. https://github.com/D-Programming-Language/dmd/pull/3459 This is order-dependent bug. If you swap the positions of two 'fun's, template fun(a...){auto fun(T...)(T args){return 2;}} auto fun(T...)(T args){return 1;} static assert(fun(0)==1); // error It will cause correct error for ambiguity. test.d(3): Error: test.fun called with argument types (int) matches both: test.d(1): test.fun!().fun!(int).fun(int) and: test.d(2): test.fun!(int).fun(int) -- |
April 19, 2014 [Issue 8373] IFTI fails on overloading of function vs non function template | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=8373 --- Comment #4 from github-bugzilla@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c542416605ea13c5601a586c21e58a4332f7819c fix Issue 8373 - IFTI fails on overloading of function vs non function template https://github.com/D-Programming-Language/dmd/commit/c87714289d25bfca41cb39bf5c0a6f12c4773119 Merge pull request #3459 from 9rnsr/fix8373 Issue 8373 - IFTI fails on overloading of function vs non function template -- |
Copyright © 1999-2021 by the D Language Foundation