Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eebd67f

Browse filesBrowse files
committed
Fix callback types to match covariantly
1 parent 8ae3e05 commit eebd67f
Copy full SHA for eebd67f

2 files changed

+2-2Lines changed: 2 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/parser.ts‎

Copy file name to clipboardExpand all lines: src/compiler/parser.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace ts {
5757
// The visitXXX functions could be written as local functions that close over the cbNode and cbNodeArray
5858
// callback parameters, but that causes a closure allocation for each invocation with noticeable effects
5959
// on performance.
60-
const visitNodes: (cb: (node: Node | Node[]) => T, nodes: Node[]) => T = cbNodeArray ? visitNodeArray : visitEachNode;
60+
const visitNodes: (cb: ((node: Node) => T) | ((node: Node[]) => T), nodes: Node[]) => T = cbNodeArray ? visitNodeArray : visitEachNode;
6161
const cbNodes = cbNodeArray || cbNode;
6262
switch (node.kind) {
6363
case SyntaxKind.QualifiedName:
Collapse file

‎src/compiler/visitor.ts‎

Copy file name to clipboardExpand all lines: src/compiler/visitor.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ namespace ts {
885885
return initial;
886886
}
887887

888-
const reduceNodes: (nodes: NodeArray<Node>, f: (memo: T, node: Node | NodeArray<Node>) => T, initial: T) => T = cbNodeArray ? reduceNodeArray : reduceLeft;
888+
const reduceNodes: (nodes: NodeArray<Node>, f: ((memo: T, node: Node) => T) | ((memo: T, node: NodeArray<Node>) => T), initial: T) => T = cbNodeArray ? reduceNodeArray : reduceLeft;
889889
const cbNodes = cbNodeArray || cbNode;
890890
const kind = node.kind;
891891

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.