[Issue 14633] DDoc: false warnings for missing parameters on template declaration

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 31 06:58:09 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14633

--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Lionello Lunesu from comment #3)
> I don't agree with all the new test cases.
> 
> Note that "ditto" is as if you'd copy-paste the entire comment on the new
> declaration. So 'unrelated' is not unrelated. It's just as related as the
> other parts. Which is why with the current PR there's not warning emitted
> for `xr` and `XT` (same as `r` and `T`.)

I didn't check the documentation result of my case. Le'ts see it.

template case1(T)
alias case2 = case1!int.case1(R)(R r);
alias case3 = unrelated!int.unrelated(XR)(XR xr);
  Blah

  Params:
    T       The warning for this documentation should be suppressed
    R       The warning for this documentation should be suppressed
    R r     The warning for this documentation should be suppressed
    XT      This documentation should be warned
    XR      This documentation should be warned
    XR xr   This documentation should be warned

Hmm, XT is not documented in the signatures, but others are appeared.

> I also don't agree that we should allow `R` (nor `XR`) to be documented on
> the parent. The only reason to have this pattern [explicit template with
> nested eponymous template] is to allow one explicit template parameter
> (`T`), while at the same time having overloads where the other template
> parameter(s) (`R`) are deduced from the regular function parameter (`r`.)
> Instantiating the template by specifying (and therefor documenting) both
> template parameters seem useless. (I don't even know what that instantiation
> should look like.)

R and XR can be specified explicitly via the aliases case2 and case3.

    case2!string("a");     // R == string
    case3!(int[])([1,2]);  // 

And more, currently documenting T in the following code is not warned.

/**
Blah
Params:
  T = x
  t = y
*/
void foo(T)(T t) {}

--


More information about the Digitalmars-d-bugs mailing list