Bug 10548 – [REG 2.064a] argument has no identifier

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-05T03:58:00Z
Last change time
2013-07-07T13:48:03Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
yazan.dabain

Comments

Comment #0 by yazan.dabain — 2013-07-05T03:58:06Z
import std.stdio, std.traits; int foo(int num, string name); void main() { void bar(int num){} static if (is(FunctionTypeOf!bar PT == __parameters)) { pragma(msg, __traits(identifier, PT[0..1])); } } Compiling this code using dmd 2.063, you get "num" printed out. In dmd 2.064a, the compiler prints: ------ main.d(8): Error: argument int has no identifier false ------ This regression is caused by commit: 877e7bf pull request: https://github.com/D-Programming-Language/dmd/pull/1102 fixing: http://d.puremagic.com/issues/show_bug.cgi?id=3646 This is blocking: https://github.com/D-Programming-Language/phobos/pull/1378
Comment #1 by k.hara.pg — 2013-07-06T07:47:22Z
This is expected change. After pull #1102 change, default arguments and parameter identifiers never appear in the result of FunctionTypeOf template.
Comment #2 by k.hara.pg — 2013-07-07T05:55:45Z
Sorry, the above comment was my mistake. Finally I've concluded that the current git head behavior is *unnecessarily* restrictive. I reconsidered about it and convinced that fixing this *regression* won't introduce any dangerous semantics. I reopen this issue.
Comment #3 by k.hara.pg — 2013-07-07T06:20:52Z
Comment #4 by github-bugzilla — 2013-07-07T13:47:51Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7f932696732c9f8237b039b72342e3080ddd8c11 Issue 10548 - argument has no identifier Don't strip default args and parameter names on alias declarations. Instead do it against template type arguments. https://github.com/D-Programming-Language/dmd/commit/0f36bb59d3f4be01b19510d7c625ed458f00b831 Merge pull request #2311 from 9rnsr/improveDefArgs [REG2.064a] Issue 10548 - argument has no identifier