Skip to content

factory: createArrowFunction doesn't parenthesize comma list as concise body #25366

New issue

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

Closed
ajafff opened this issue Jul 2, 2018 · 1 comment
Closed
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Help Wanted You can do this

Comments

@ajafff
Copy link
Contributor

ajafff commented Jul 2, 2018

TypeScript Version: 3.0.0-dev.20180630

Search Terms:

Code

import * as ts from 'typescript';

const n = ts.createArrowFunction(
    /*modifiers*/ undefined,
    /*typeParameters*/ undefined,
    [],
    /*type*/ undefined,
    /*equalsGreaterThanToken*/ undefined,
   ts.createBinary(ts.createLiteral('a'), ts.SyntaxKind.CommaToken, ts.createLiteral('b')),
);
ts.createPrinter().printNode(ts.EmitHint.Unspecified, n, ts.createSourceFile('dummy.ts', '', ts.ScriptTarget.Latest));

Expected behavior:

() => ("a", "b")

Actual behavior:

() => "a", "b"

// which parses as
(() => "a"), "b"
@mhegazy mhegazy added Bug A bug in TypeScript Help Wanted You can do this API Relates to the public API for TypeScript labels Jul 2, 2018
@mhegazy mhegazy added this to the Community milestone Jul 2, 2018
@ajafff
Copy link
Contributor Author

ajafff commented Jul 3, 2018

I'll fix this once my approach for testing in #25342 is approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants