Skip to content

Merge conflict tags in *.tsx crash Typescript compiler #12952

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
guncha opened this issue Dec 15, 2016 · 1 comment
Closed

Merge conflict tags in *.tsx crash Typescript compiler #12952

guncha opened this issue Dec 15, 2016 · 1 comment
Labels
Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter Fixed A PR has been merged for this issue

Comments

@guncha
Copy link

guncha commented Dec 15, 2016

TypeScript Version: "2.2.0-dev.20161215"

Code

// index.ts
const x = <div>
<<<<<<< HEAD
# command line
tsc index.ts

Expected behavior:

Show errors about malformed tags.

Actual behavior:

Crashes with assertion failure:

/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:49806
                throw e;
                ^

Error: length < 0
    at createTextSpan (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:8304:19)
    at Object.createTextSpanFromBounds (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:8310:16)
    at getErrorSpanForNode (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:5256:19)
    at createDiagnosticForNodeInSourceFile (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:5187:20)
    at Object.createDiagnosticForNode (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:5183:16)
    at error (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:19749:22)
    at checkJsxPreconditions (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:29072:17)
    at checkJsxOpeningLikeElement (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:29082:13)
    at checkJsxSelfClosingElement (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:28781:13)
    at checkJsxElement (/Users/gunca/Code/jsx-bug/node_modules/typescript/lib/tsc.js:28802:25)
@mhegazy mhegazy added the Bug A bug in TypeScript label Dec 15, 2016
@mhegazy mhegazy added this to the TypeScript 2.2 milestone Dec 15, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.2, TypeScript 2.3 Feb 2, 2017
@yuit yuit added the Domain: JSX/TSX Relates to the JSX parser and emitter label Feb 16, 2017
@yuit
Copy link
Contributor

yuit commented Feb 16, 2017

The original issue using .ts is fixed in the most recent nightly build. However, if the file is a .tsx instead the error still get produced

@yuit yuit added the Fixed A PR has been merged for this issue label Feb 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants