8000 Ternary operator parse error (TS 2.5) · Issue #18204 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Ternary operator parse error (TS 2.5) #18204
Closed
@alexanderby

Description

@alexanderby

TypeScript Version: 2.5.2

Code

> tsc script.js --allowJs --outFile result.js

var xMapper = isXPeriod ?
    (createPeriodCaster(props.x.period)) :
    (function (x) {
        return x;
    });

Expected behavior:

Should compile OK

Actual behavior:

script.js(2,24): error TS1005: '=' expected.
script.js(3,5): error TS8010: 'types' can only be used in a .ts file.
script.js(3,19): error TS1005: ')' expected.
script.js(5,6): error TS1005: ':' expected.

TypeScript 2.4.1 worked OK.

Metadata

Metadata

Assignees

Labels

DuplicateAn existing issue was already created

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0