fix fossilizing Void->Void

This commit is contained in:
2024-10-27 18:03:25 -05:00
parent 8a20705008
commit 2d495a4619

View File

@@ -552,7 +552,7 @@ class Kiss {
static final fossilStart = "\n\t// BEGIN KISS FOSSIL CODE\n\t// "; // TODO remove the boneyard comments static final fossilStart = "\n\t// BEGIN KISS FOSSIL CODE\n\t// "; // TODO remove the boneyard comments
static final fossilEnd = "\t// END KISS FOSSIL CODE\n"; static final fossilEnd = "\t// END KISS FOSSIL CODE\n";
static function complexTypeToString(type:ComplexType) { static function complexTypeToString(type:ComplexType, emptyForVoid = false) {
var fossilCode = ""; var fossilCode = "";
switch (type) { switch (type) {
case TPath(path): case TPath(path):
@@ -577,7 +577,7 @@ class Kiss {
} }
case TFunction(args, ret): case TFunction(args, ret):
fossilCode += "("; fossilCode += "(";
fossilCode += [for (arg in args) complexTypeToString(arg)].join(","); fossilCode += [for (arg in args) complexTypeToString(arg, true)].join(",");
fossilCode += ")->"; fossilCode += ")->";
fossilCode += complexTypeToString(ret); fossilCode += complexTypeToString(ret);
case TAnonymous(fields): case TAnonymous(fields):
@@ -595,6 +595,7 @@ class Kiss {
default: default:
fossilCode += '{ComplexType $type not supported for fossilization}'; fossilCode += '{ComplexType $type not supported for fossilization}';
} }
if (emptyForVoid && fossilCode == "Void") return "";
return fossilCode; return fossilCode;
} }