-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.0.3
Code
// Next is line 241
export class ShortDetails extends React.Component<{ id: number }, {}> {
public render(): JSX.Element {
if (this.props.id < 1) {
return (<div></div>);
}
}
}
Expected behavior:
It should compile well. Many variations to the code would avoid the errors, like:
- Compact into
<div/>
- Replace
< 1
by<= 0
Actual behavior:
Scripts/Components/Details.tsx(243,30): error TS1005: ',' expected.
Scripts/Components/Details.tsx(244,21): error TS1138: Parameter declaration expected.
Scripts/Components/Details.tsx(244,26): error TS1005: '(' expected.
Scripts/Components/Details.tsx(244,28): error TS1131: Property or signature expected.
Scripts/Components/Details.tsx(244,32): error TS1005: '(' expected.
Scripts/Components/Details.tsx(244,33): error TS1005: ')' expected.
Scripts/Components/Details.tsx(247,1): error TS1128: Declaration or statement expected.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterFixedA PR has been merged for this issueA PR has been merged for this issue