Skip to content
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

Tsc crash ("Debug Failure. False expression:") #10522

Closed
kpreisser opened this issue Aug 24, 2016 · 6 comments · Fixed by #10538
Closed

Tsc crash ("Debug Failure. False expression:") #10522

kpreisser opened this issue Aug 24, 2016 · 6 comments · Fixed by #10538
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@kpreisser
Copy link
Contributor

Hi,
I think the following code should not cause tsc to crash:

TypeScript Version: Version 2.1.0-dev.20160824

Code (test1.ts)

export let a;
export = {};

Expected behavior:

test1.ts(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements.

Actual behavior:

C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:37652
                throw e;
                ^

Error: Debug Failure. False expression:
    at Object.assert (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:1289:23)
    at Object.fail (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:1294:19)
    at Object.findMap (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:211:15)
    at getDeclarationOfAliasSymbol (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:13935:23)
    at checkExternalModuleExports (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26465:39)
    at checkExportAssignment (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26441:13)
    at checkSourceElement (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26609:28)
    at Object.forEach (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:185:30)
    at checkSourceFileWorker (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26661:20)
    at checkSourceFile (C:\Users\VPC\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26647:13)

Note: The error seems to have been introduced with commit e900952 (with c9f62f3 I'm getting the expected error message).

Thanks!

@mhegazy mhegazy added the Bug A bug in TypeScript label Aug 24, 2016
@mhegazy mhegazy added this to the TypeScript 2.0.1 milestone Aug 24, 2016
@mhegazy mhegazy assigned ghost Aug 24, 2016
@ghost
Copy link

ghost commented Aug 24, 2016

Related to #10460

@sandersn
Copy link
Member

It's pretty close to a dupe. I'll fix it with #10460.

@sandersn
Copy link
Member

Fix is up at #10538

@Ciantic
Copy link

Ciantic commented Dec 10, 2016

tsc --version
Version 2.2.0-dev.20161210

I'm getting error:

Error: Debug Failure. False expression

My only TS file is test.ts with this:

import { Collapse } from '@blueprintjs/core';

very odd.

@Ciantic
Copy link

Ciantic commented Dec 10, 2016

Here is cloneable gist: https://gist.github.com/Ciantic/60e9dbe330922cfc41086e255820df62

$ tsc --version
Version 2.2.0-dev.20161210
$ npm install
$ tsc
...\typescript\lib\tsc.js:1796
                throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString);
                ^

Error: Debug Failure. False expression:

@mhegazy
Copy link
Contributor

mhegazy commented Dec 10, 2016

@Ciantic, this is a different issue. the debug message is the same for all debug asserts. I have filed a new issue to track this: #12827

seems that the problem is that @blueprintjs/core augments tether, but does not have a dependency on @types/tether in package.json.

Installing the @types/tether should avoid this error. but really the fix should be in @blueprintjs/core package.json.

either ways, the compiler should not crash, and #12827 tracks fixing that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants