Skip to content

Commit

Permalink
fix: correct typing for C String return type
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni committed Jun 25, 2024
1 parent 1e0a8c6 commit 73af937
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions metadata-generator/src/TypeScript/DefinitionWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,11 +883,9 @@ std::string DefinitionWriter::tsifyType(const Type& type, const bool isFuncParam
case TypeSelector:
return "string";
case TypeCString: {
std::string res = "string";
if (isFuncParam) {
Type typeVoid(TypeVoid);
res += " | " + tsifyType(::Meta::PointerType(&typeVoid), isFuncParam);
}
std::string res = isFuncParam ? "string | " : "";
Type typeVoid(TypeVoid);
res += tsifyType(::Meta::PointerType(&typeVoid), isFuncParam);
return res;
}
case TypeProtocol:
Expand Down

0 comments on commit 73af937

Please sign in to comment.