Skip to content

Commit

Permalink
ddoc: Only add constraint macro if it's a funcdecl
Browse files Browse the repository at this point in the history
  • Loading branch information
landaire committed Dec 22, 2015
1 parent 4308b39 commit 6d9d1b9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/doc.d
Original file line number Diff line number Diff line change
Expand Up @@ -1236,9 +1236,18 @@ extern (C++) void toDocBuffer(Dsymbol s, OutBuffer* buf, Scope* sc)
// emit constraints if declaration is a templated declaration
if (td && td.constraint)
{
buf.writestring("$(DDOC_CONSTRAINT ");
bool funcDecl = td.isFuncDeclaration() is null;
if (funcDecl)
{
buf.writestring("$(DDOC_CONSTRAINT ");
}

.toCBuffer(td.constraint, buf, &hgs);
buf.writeByte(')');

if (funcDecl)
{
buf.writeByte(')');
}
}
if (d.isDeprecated())
buf.writestring(")");
Expand Down

0 comments on commit 6d9d1b9

Please sign in to comment.