We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whenever a type predicate is used, as in the following example:
function foo(value: any): value is string { return true; }
The factory code generator does not handle the type predicate node correctly:
factory.createFunctionDeclaration( undefined, undefined, undefined, factory.createIdentifier("foo"), undefined, [factory.createParameterDeclaration( undefined, undefined, undefined, factory.createIdentifier("value"), undefined, factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword), undefined )], factory.createTypePredicateNode(undefined, factory.createIdentifier("value"), factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)), factory.createBlock( [factory.createReturnStatement(factory.createTrue())], true ) )
factory.createFunctionDeclaration( undefined, undefined, undefined, factory.createIdentifier("foo"), undefined, [factory.createParameterDeclaration( undefined, undefined, undefined, factory.createIdentifier("value"), undefined, factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword), undefined )], /* Unhandled node kind: TypePredicate */, factory.createBlock( [factory.createReturnStatement(factory.createTrue())], true ) )
Diff in summary (red is current behavior, green is desired):
- /* Unhandled node kind: TypePredicate */, + factory.createTypePredicateNode(undefined, factory.createIdentifier("value"), factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)),
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Whenever a type predicate is used, as in the following example:
The factory code generator does not handle the type predicate node correctly:
Expected
Actual
Diff in summary (red is current behavior, green is desired):
The text was updated successfully, but these errors were encountered: