|
@@ -93,7 +93,7 @@ class Printer {
|
|
// TODO: check if this can cause loops
|
|
// TODO: check if this can cause loops
|
|
public function printComplexType(ct:ComplexType) return switch(ct) {
|
|
public function printComplexType(ct:ComplexType) return switch(ct) {
|
|
case TPath(tp): printTypePath(tp);
|
|
case TPath(tp): printTypePath(tp);
|
|
- case TFunction(args, ret): args.map(printComplexType).join(" -> ") + " -> " + printComplexType(ret);
|
|
|
|
|
|
+ case TFunction(args, ret): (args.length>0 ? args.map(printComplexType).join(" -> ") : "Void") + " -> " + printComplexType(ret);
|
|
case TAnonymous(fields): "{ " + [for (f in fields) printField(f) + "; "].join("") + "}";
|
|
case TAnonymous(fields): "{ " + [for (f in fields) printField(f) + "; "].join("") + "}";
|
|
case TParent(ct): "(" + printComplexType(ct) + ")";
|
|
case TParent(ct): "(" + printComplexType(ct) + ")";
|
|
case TOptional(ct): "?" + printComplexType(ct);
|
|
case TOptional(ct): "?" + printComplexType(ct);
|