Bug 13374 – Wrong template overload resolution when passing function to alias/string parameter

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-24T23:53:00Z
Last change time
2015-04-30T00:57:15Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
dlang-bugzilla
See also
https://issues.dlang.org/show_bug.cgi?id=14520

Comments

Comment #0 by dlang-bugzilla — 2014-08-24T23:53:17Z
///// test.d ///// void f(alias a)() { } void f(string s)() { } void x(int i) {} void main() { f!x(); } ////////////////// Compiler attempts to evaluate x despite that it's impossible and its return type is not convertible to a string. But even if x took no arguments and returned a string, there needs to be a way to pass the function by alias, not by its evaluation result. Introduced in https://github.com/D-Programming-Language/dmd/pull/599
Comment #1 by dlang-bugzilla — 2014-08-25T00:42:19Z
> But even if x took no arguments and returned a string, there needs to be a way > to pass the function by alias, not by its evaluation result. Even with -property, the compiler still attempts to evaluate it while complaining that "Error: not a property x".
Comment #2 by k.hara.pg — 2014-08-25T17:40:42Z
Comment #3 by github-bugzilla — 2014-08-25T21:26:30Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/586686e5fc2fa3350d6703b3122698362ad0f417 fix Issue 13374 - Wrong template overload resolution when passing function to alias/string parameter https://github.com/D-Programming-Language/dmd/commit/639bcaac6fe240a212ddbfa9bfee387f6e2697d4 Merge pull request #3897 from 9rnsr/fix13374 [REG2.061] Issue 13374 - Wrong template overload resolution when passing function to alias/string parameter
Comment #4 by github-bugzilla — 2014-08-28T04:10:19Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/71af9f57a5f80edc7d9ce17280ce57ad7a242839 Merge pull request #3897 from 9rnsr/fix13374 [REG2.061] Issue 13374 - Wrong template overload resolution when passing function to alias/string parameter