Undefined JSX.Element crashes typechecker with function in element #7286
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
Milestone
TypeScript Version:
1.8.2
Code
tsconfig.json:
app.tsx:
Expected behavior:
Successful compilation, because undefined JSX.Element should be treated as any type.
Actual behavior:
Throws exception:
typescript/lib/tsc.js:32989
throw e;
^
TypeError: Cannot read property 'flags' of undefined
at isRelatedTo (typescript\lib\tsc.js:15954:32)
at checkTypeRelatedTo (typescript\lib\tsc.js:15882:26)
at checkTypeAssignableTo (typescript\lib\tsc.js:15760:20)
at isTypeAssignableTo (typescript\lib\tsc.js:15754:20)
at getJsxElementAttributesType (typescript\lib\tsc.js:18394:47)
at checkJsxOpeningLikeElement (typescript\lib\tsc.js:18495:40)
at checkJsxElement (typescript\lib\tsc.js:18200:13)
at checkExpressionWorker (typescript\lib\tsc.js:20367:28)
at checkExpression (typescript\lib\tsc.js:20279:42)
at checkExpressionStatement (typescript\lib\tsc.js:21539:13)
The text was updated successfully, but these errors were encountered: