This PR cherry-picks the following commits: -03902d8e85-1a43adc506--------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
aa9f6fb718
commit
8709a3a24b
|
|
@ -566,7 +566,7 @@ class Type {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedType.args) {
|
if (parsedType.args || parsedType.retType) {
|
||||||
const type = new Type('function');
|
const type = new Type('function');
|
||||||
type.args = [];
|
type.args = [];
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
@ -737,7 +737,8 @@ function parseTypeExpression(type) {
|
||||||
if (type[i] === '(') {
|
if (type[i] === '(') {
|
||||||
name = type.substring(0, i);
|
name = type.substring(0, i);
|
||||||
const matching = matchingBracket(type.substring(i), '(', ')');
|
const matching = matchingBracket(type.substring(i), '(', ')');
|
||||||
args = parseTypeExpression(type.substring(i + 1, i + matching - 1));
|
const argsString = type.substring(i + 1, i + matching - 1);
|
||||||
|
args = argsString ? parseTypeExpression(argsString) : null;
|
||||||
i = i + matching;
|
i = i + matching;
|
||||||
if (type[i] === ':') {
|
if (type[i] === ':') {
|
||||||
retType = parseTypeExpression(type.substring(i + 1));
|
retType = parseTypeExpression(type.substring(i + 1));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue