Skip to content

Commit ba8595b

Browse files
authored
Merge pull request microsoft#27021 from ajafff/fix-functiontype-emit
Fix FunctionType emit when only parameter has no type
2 parents e9c6d96 + 66a401a commit ba8595b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/compiler/emitter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,8 @@ namespace ts {
28182818
const parameter = singleOrUndefined(parameters);
28192819
return parameter
28202820
&& parameter.pos === parentNode.pos // may not have parsed tokens between parent and parameter
2821-
&& !(isArrowFunction(parentNode) && parentNode.type) // arrow function may not have return type annotation
2821+
&& isArrowFunction(parentNode) // only arrow functions may have simple arrow head
2822+
&& !parentNode.type // arrow function may not have return type annotation
28222823
&& !some(parentNode.decorators) // parent may not have decorators
28232824
&& !some(parentNode.modifiers) // parent may not have modifiers
28242825
&& !some(parentNode.typeParameters) // parent may not have type parameters
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[args => any, <T>(args) => any, (...args) => any, (args?) => any, (args: any) => any, ({}) => any]
1+
[(args) => any, <T>(args) => any, (...args) => any, (args?) => any, (args: any) => any, ({}) => any]

0 commit comments

Comments
 (0)