Fix issues in ComplexType -> Type conversion for functions.

This commit is contained in:
Juraj Kirchheim
2020-06-26 15:09:21 +02:00
parent 8c50dcf04b
commit b5e992b820

View File

@@ -95,8 +95,12 @@ class Sisyphus {
TPath(toTypePath(baseType, params));
case TFun(args, ret):
TFunction(
[ for (a in args) a.opt ? nullable(toComplexType(a.t)) : toComplexType(a.t) ],
toComplexType(ret));
[for (a in args) {
var t = TNamed(a.name, toComplexType(a.t));
if (a.opt) TOptional(t) else t;
}],
toComplexType(ret)
);
case TAnonymous(_.get() => { fields: fields }):
TAnonymous([ for (cf in fields) toField(cf) ]);
case TDynamic(t):