Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dstep/translator/Type.d
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,11 @@ do
if (declaration.isValid)
return translateType(context, declaration, rewriteIdToObjcObject);
else
{
type = type.canonical.isValid ? type.canonical : type;
return translateType(context, type.kind, rewriteIdToObjcObject)
.makeSourceNode();
}
}

string translateComplex (Type type)
Expand Down
8 changes: 8 additions & 0 deletions tests/functional/Tests.d
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ unittest
);
}

unittest
{
assertRunsDStepCFile(
"tests/functional/size_t_redeclared.d",
"tests/functional/size_t_redeclared.h"
);
}

// DStep should exit with non-zero status when an input file doesn't exist.
unittest
{
Expand Down
6 changes: 6 additions & 0 deletions tests/functional/size_t_redeclared.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import core.stdc.config;

extern (C):

c_ulong strlen (const(char)* __s);
c_ulong fread ();
6 changes: 6 additions & 0 deletions tests/functional/size_t_redeclared.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#include <stdio.h>

size_t strlen(const char *__s);
size_t fread();