Bug 16988 – Ddoc doesn't recognize parameters in eponymous CT templates

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-12-20T00:17:36Z
Last change time
2024-12-13T18:51:02Z
Assigned to
No Owner
Creator
Seb
Moved to GitHub: dmd#19217 →

Comments

Comment #0 by greeenify — 2016-12-20T00:17:36Z
The following example will trigger an error with dmd: ``` /++ Multiplies the stride of the selected dimension by a factor. Params: slice = input slice Dimensions = indexes of dimensions to be strided factors = list of step extension factors factor = step extension factors Returns: n-dimensional slice of the same type +/ template strided(Dimensions...) if (Dimensions.length) { static if (1 == 2) auto strided(size_t N, Range)(Slice!(N, Range) slice, Repeat!(Dimensions.length, size_t) factor){} else auto strided(size_t N, Range)(Slice!(N, Range) slice, Repeat!(Dimensions.length, size_t) factors){} } ``` with `dmd -w -D` yields: ``` foo.d(11): Warning: Ddoc: function declaration has no parameter 'slice' foo.d(11): Warning: Ddoc: function declaration has no parameter 'factors' foo.d(11): Warning: Ddoc: function declaration has no parameter 'factor' ``` without the static if it works fine.
Comment #1 by robert.schadek — 2024-12-13T18:51:02Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19217 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB