D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8739 - DDoc outputs wrong parameter name in delegate parameter list
Summary: DDoc outputs wrong parameter name in delegate parameter list
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: Andrej Mitrovic
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2012-09-29 22:58 UTC by Jakob Ovrum
Modified: 2013-11-24 06:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jakob Ovrum 2012-09-29 22:58:02 UTC
The following code:
----------------------------------------

void delegate(int a) dg;

/// Test - this works
void delegate(int b) dg2;

/// Test - this doesn't
void delegate(int c)[] dg3;

/// Another test - this doesn't either
void delegate(int d)* dg4;

void main() {}

----------------------------------------
Produces the following DDoc output for the symbol 'dg2':

    void delegate(int b) dg2; 
        Test - this works

    void delegate(int a)[] dg3; 
        Test - this doesn't

    void delegate(int a)* dg4; 
        Another test - this doesn't either

Notice how the name of the first parameter is wrong when the delegate is part of a composite type (dg3 and dg4). It does not happen when the variable is of plain delegate type (as is the case of dg2). It seems to happen even in cases when dg is in an imported module.

I don't know if this is a regression - if it is, it's not a recent one. I tested on versions 2.060, 2.059, 2.058 and 2.057; they all exhibit the exact same problem.
Comment 1 Jakob Ovrum 2012-09-29 22:59:39 UTC
(In reply to comment #0)
> Produces the following DDoc output for the symbol 'dg2':

Ignore this, I meant it produces the following output for the four symbols.
Comment 2 github-bugzilla 2012-10-27 00:55:20 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/626dfe5141f779fae4843c47a3f8f6af364ea0b4
Fixes Issue 8739 - Use syntaxCopy when preserving original type to output original parameter names.

https://github.com/D-Programming-Language/dmd/commit/dd79dd73f0a1553ff4237d759cea92e7222dccbb
Merge pull request #1224 from AndrejMitrovic/Fix8739

Fix Issue 8739 - DDoc outputs wrong parameter name in delegate parameter list
Comment 3 yebblies 2012-10-27 01:02:50 UTC
Fixed for D2, still exists in D1
Comment 4 yebblies 2013-11-24 04:48:25 UTC
(In reply to comment #3)
> Fixed for D2, still exists in D1

Fixed for D2, D1 is no longer supported.