-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Bug Report
π Version & Regression Information
- This is a parsing error on 4.5(maybe lower), 4.6-dev
β― Playground Link
π» Code
Parsed JS
!a
? (a = (function () {})())
: (function(a){})(a);import { createPrinter, createSourceFile, ScriptTarget } from "typescript";
const source = `!a
? (a = (function () {})())
: (function(a){return !0})(a);`
console.log(
createPrinter().printFile(
createSourceFile(`test.js`, source, ScriptTarget.Latest)
)
);π Actual behavior
Wrong JS/TS.
!a
? (a = (function () { })()): (function(: a):) => { } : ;
(a);Local tsc for example.ts code make
"use strict";
!a
? (a = (function () { })()) => { } : ;
(a);π Expected behavior
!a
? (a = (function () { })()): (function (a) { })(a); ;
(a);whzx5byb
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue