Add helper for transforming TypeParameter to TypeParamDecl.

This commit is contained in:
Juraj Kirchheim
2019-01-02 16:58:42 +01:00
parent b7e413d839
commit 380ceb39ea

View File

@@ -247,4 +247,13 @@ class Types {
default: '';
}
static public function toDecl(p:TypeParameter):TypeParamDecl
return {
name: p.name,
constraints: switch p.t {
case TInst(_.get() => { kind: KTypeParameter(c)}, _): [for(c in c) c.toComplex()];
case _: throw 'unreachable';
}
}
}