Skip to content

Crash when trying to merge global augmentation #25410

Closed
@timocov

Description

@timocov

TypeScript Version: 3.0.0-dev.20180703

Search Terms: Global augmentation

Code

  1. mkdir src && echo "import * as React from 'react';console.log(React);" > src/index.ts
  2. mkdir tests && echo "import * as React from 'react';console.log(React);" > tests/index.ts
  3. npm init -y && npm install --save-dev typescript@next @types/react
  4. cd tests && npm init -y && npm install --save-dev @types/react && cd ../
  5. ./node_modules/.bin/tsc --init
  6. ./node_modules/.bin/tsc --noEmit

Expected behavior:

Compiled without errors

Actual behavior:

Error: Debug Failure. False expression.
    at mergeSymbol (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:24252:26)
    at E:\git\ts-bug\node_modules\typescript\lib\tsc.js:24344:49
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:24343:20)
    at mergeModuleAugmentation (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:24354:17)
    at initializeTypeChecker (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:45114:25)
    at Object.createTypeChecker (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:24102:9)
    at getDiagnosticsProducingTypeChecker (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:66941:93)
    at Object.getGlobalDiagnostics (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:67286:53)
    at Object.emitFilesAndReportErrors (E:\git\ts-bug\node_modules\typescript\lib\tsc.js:69563:46)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions