mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 22:32:33 -05:00
Fix callback types to match covariantly
This commit is contained in:
@@ -57,7 +57,7 @@ namespace ts {
|
||||
// The visitXXX functions could be written as local functions that close over the cbNode and cbNodeArray
|
||||
// callback parameters, but that causes a closure allocation for each invocation with noticeable effects
|
||||
// on performance.
|
||||
const visitNodes: (cb: (node: Node | Node[]) => T, nodes: Node[]) => T = cbNodeArray ? visitNodeArray : visitEachNode;
|
||||
const visitNodes: (cb: ((node: Node) => T) | ((node: Node[]) => T), nodes: Node[]) => T = cbNodeArray ? visitNodeArray : visitEachNode;
|
||||
const cbNodes = cbNodeArray || cbNode;
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.QualifiedName:
|
||||
|
||||
Reference in New Issue
Block a user