-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.3.2
Code
import ts = require("typescript");
function getAnyFunctionTypeNode() {
const param = ts.createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
ts.createToken(ts.SyntaxKind.DotDotDotToken),
"args");
const result = ts.createFunctionTypeNode(
/*typeParameters*/ undefined,
/*parameters*/[param],
/*type*/ ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword));
return result;
}
const node = getAnyFunctionTypeNode();
const file = ts.createSourceFile("foo.ts", "", ts.ScriptTarget.Latest, /*setParentNodes*/ false, ts.ScriptKind.TS);
const output = ts.createPrinter().printNode(ts.EmitHint.Unspecified, node, file);
console.log(output);Expected behavior:
Console logs the following:
(...args) => any
Actual behavior:
Console logs the following:
...args => any
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue