Skip to content

Commit

Permalink
Use in createGetSymbolWalker
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Hanson committed Oct 5, 2017
1 parent cadf250 commit 7001e71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 12 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,18 @@ namespace ts {
getEmitResolver,
getExportsOfModule: getExportsOfModuleAsArray,
getExportsAndPropertiesOfModule,
getSymbolWalker: createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier),
getSymbolWalker: createGetSymbolWalker(
getRestTypeOfSignature,
getTypePredicateOfSignature,
getReturnTypeOfSignature,
getBaseTypes,
resolveStructuredTypeMembers,
getTypeOfSymbol,
getResolvedSymbol,
getIndexTypeOfStructuredType,
getConstraintFromTypeParameter,
getFirstIdentifier,
),
getAmbientModules,
getAllAttributesTypeFromJsxOpeningLikeElement: node => {
node = getParseTreeNode(node, isJsxOpeningLikeElement);
Expand Down
6 changes: 4 additions & 2 deletions src/compiler/symbolWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace ts {
export function createGetSymbolWalker(
getRestTypeOfSignature: (sig: Signature) => Type,
getTypePredicateOfSignature: (sig: Signature) => TypePredicate | undefined,
getReturnTypeOfSignature: (sig: Signature) => Type,
getBaseTypes: (type: Type) => Type[],
resolveStructuredTypeMembers: (type: ObjectType) => ResolvedType,
Expand Down Expand Up @@ -117,8 +118,9 @@ namespace ts {
}

function visitSignature(signature: Signature): void {
if (signature.typePredicate) {
visitType(signature.typePredicate.type);
const typePredicate = getTypePredicateOfSignature(signature);
if (typePredicate) {
visitType(typePredicate.type);
}
forEach(signature.typeParameters, visitType);

Expand Down

0 comments on commit 7001e71

Please sign in to comment.