Skip to content

Commit

Permalink
fix Issue 13832 - delegates that return ref do not output correctly t…
Browse files Browse the repository at this point in the history
…o .di file
  • Loading branch information
9rnsr committed Dec 15, 2014
1 parent 8597cda commit 3fc5b66
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hdrgen.c
Expand Up @@ -1657,16 +1657,19 @@ class PrettyPrintVisitor : public Visitor
{
buf->writestring(d->ident->toChars());
buf->writestring(" = ");
StorageClassDeclaration::stcToCBuffer(buf, d->storage_class);
d->aliassym->accept(this);
}
else if (d->type->ty == Tfunction)
{
StorageClassDeclaration::stcToCBuffer(buf, d->storage_class);
typeToBuffer(d->type, d->ident);
}
else
{
buf->writestring(d->ident->toChars());
buf->writestring(" = ");
StorageClassDeclaration::stcToCBuffer(buf, d->storage_class);
typeToBuffer(d->type, NULL);
}
buf->writeByte(';');
Expand Down
3 changes: 3 additions & 0 deletions test/compilable/extra-files/header1.d
Expand Up @@ -440,3 +440,6 @@ pure clamp12266b(T1, T2, T3)(T1 x, T2 min_val, T3 max_val)
{
return 0;
}

// 13832
alias Dg13832 = ref int delegate();
1 change: 1 addition & 0 deletions test/compilable/extra-files/header1.di
Expand Up @@ -406,3 +406,4 @@ pure clamp12266b(T1, T2, T3)(T1 x, T2 min_val, T3 max_val)
{
return 0;
}
alias Dg13832 = ref int delegate();
1 change: 1 addition & 0 deletions test/compilable/extra-files/header1i.di
Expand Up @@ -531,3 +531,4 @@ pure clamp12266b(T1, T2, T3)(T1 x, T2 min_val, T3 max_val)
{
return 0;
}
alias Dg13832 = ref int delegate();

0 comments on commit 3fc5b66

Please sign in to comment.