mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Merge pull request #27021 from ajafff/fix-functiontype-emit
Fix FunctionType emit when only parameter has no type
This commit is contained in:
@@ -2818,7 +2818,8 @@ namespace ts {
|
||||
const parameter = singleOrUndefined(parameters);
|
||||
return parameter
|
||||
&& parameter.pos === parentNode.pos // may not have parsed tokens between parent and parameter
|
||||
&& !(isArrowFunction(parentNode) && parentNode.type) // arrow function may not have return type annotation
|
||||
&& isArrowFunction(parentNode) // only arrow functions may have simple arrow head
|
||||
&& !parentNode.type // arrow function may not have return type annotation
|
||||
&& !some(parentNode.decorators) // parent may not have decorators
|
||||
&& !some(parentNode.modifiers) // parent may not have modifiers
|
||||
&& !some(parentNode.typeParameters) // parent may not have type parameters
|
||||
|
||||
@@ -1 +1 @@
|
||||
[args => any, <T>(args) => any, (...args) => any, (args?) => any, (args: any) => any, ({}) => any]
|
||||
[(args) => any, <T>(args) => any, (...args) => any, (args?) => any, (args: any) => any, ({}) => any]
|
||||
Reference in New Issue
Block a user