"function" without followed by "(" should be considered as Global function type

This commit is contained in:
Yui T
2017-05-29 20:37:01 -07:00
parent bcf84f4958
commit 4838eff2d7
2 changed files with 5 additions and 1 deletions

View File

@@ -6855,6 +6855,7 @@ namespace ts {
case "Object":
return anyType;
case "Function":
case "function":
return globalFunctionType;
case "Array":
case "array":

View File

@@ -6075,7 +6075,10 @@ namespace ts {
case SyntaxKind.OpenBraceToken:
return parseJSDocRecordType();
case SyntaxKind.FunctionKeyword:
return parseJSDocFunctionType();
if (lookAhead(nextTokenIsOpenParen)) {
return parseJSDocFunctionType();
}
break;
case SyntaxKind.DotDotDotToken:
return parseJSDocVariadicType();
case SyntaxKind.NewKeyword: