Bug 15152 – [REG2.069.0-devel] template fails to instantiate if argument is itself a template

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-04T15:20:00Z
Last change time
2017-08-02T08:07:36Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
schuetzm

Comments

Comment #0 by schuetzm — 2015-10-04T15:20:43Z
// xx.d struct ErrorDisplayAttribute(alias DISPLAY_METHOD) { enum displayMethodName = __traits(identifier, DISPLAY_METHOD); } void foo1() { } private void handleRequest(string M)() { } void main() { enum erruda_value = ErrorDisplayAttribute!(foo1).init; static if(true) { // change to `false` to make it compile handleRequest!(erruda_value.displayMethodName); // line 12 } else { enum temp = erruda_value.displayMethodName; handleRequest!(temp); } } # dmd -c xx.d xx.d(12): Error: template instance handleRequest!(displayMethodName) does not match template declaration handleRequest(string M)() According to digger, this was introduced in: https://github.com/D-Programming-Language/dmd/pull/5123
Comment #1 by k.hara.pg — 2015-10-05T10:38:24Z
Comment #2 by github-bugzilla — 2015-10-06T04:52:09Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4d1b0864d25660fdd347146c4a19ad9ba878a3bb fix Issue 15152 - template fails to instantiate if argument is itself a template https://github.com/D-Programming-Language/dmd/commit/8830d971f730ff938b2628020f70b194c55854d2 Merge pull request #5163 from 9rnsr/fix15152 [REG2.069.0-devel] Issue 15152 - template fails to instantiate if argument is itself a template
Comment #3 by github-bugzilla — 2015-10-07T02:56:31Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4d1b0864d25660fdd347146c4a19ad9ba878a3bb fix Issue 15152 - template fails to instantiate if argument is itself a template https://github.com/D-Programming-Language/dmd/commit/8830d971f730ff938b2628020f70b194c55854d2 Merge pull request #5163 from 9rnsr/fix15152
Comment #4 by github-bugzilla — 2017-08-02T08:07:36Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/01de4bb5d7f9362ed9240b192d3046377047c9e1 Issue 15152 - template fails to instantiate if argument is itself a template