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

Debug Failure. False expression #30591

Closed
ca0v opened this issue Mar 26, 2019 · 6 comments
Closed

Debug Failure. False expression #30591

ca0v opened this issue Mar 26, 2019 · 6 comments
Assignees
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fixed A PR has been merged for this issue Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects")

Comments

@ca0v
Copy link

ca0v commented Mar 26, 2019

Trying to do a composite build modeled after microsoft/typescript but generating AMD modules fails:

Error: Debug Failure. False expression.
    at mergeSymbol (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:26088:26)
    at H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:26187:47
    at Map.forEach (<anonymous>)
    at mergeSymbolTable (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:26185:20)
    at initializeTypeChecker (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:49309:21)
    at Object.createTypeChecker (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:25950:9)
    at Object.getTypeChecker (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:72860:79)
    at getReferencedFiles (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:74290:43)
    at Object.create (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:74329:41)
    at createBuilderProgramState (H:\code\ca0v\speech-lab\node_modules\typescript\lib\tsc.js:74572:37)

You can find a link to the project on https://stackoverflow.com/questions/55348498/problems-building-with-typescript-transpiler-tsc-using-the-build-flag, but basically if you set the module to "amd" it fails to transpiler (works fine when outFile -> outDir).

@weswigham weswigham added Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects") labels Mar 26, 2019
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Mar 26, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.5.0 milestone Mar 26, 2019
@RyanCavanaugh
Copy link
Member

@sandersn A symbol table bug appears!

@sandersn
Copy link
Member

sandersn commented Apr 1, 2019

Repro steps:

> git clone git@github.com:ca0v/speech-lab
> cd speech-lab
> npm install
> cd tsc
> tsc -b

Edit: The following commands have no error:

> cd compiler
> tsc
> cd ../tsc
> tsc
# But this still errors, even with 'compiler' built
> tsc -b

@sandersn
Copy link
Member

sandersn commented Apr 2, 2019

Looks like the program has duplicates in its list of source files.

@sandersn sandersn assigned sheetalkamat and unassigned sandersn Apr 2, 2019
@sandersn
Copy link
Member

sandersn commented Apr 2, 2019

Adding asserts to program.ts:addFileToFilesByName moves this error a lot closer to its origin:

function addFileToFilesByName(file: SourceFile | undefined, path: Path, redirectedPath: Path | undefined) {
    Debug.assert(!filesByName.has(path), "duplicate path");
    if (redirectedPath) {
	Debug.assert(!filesByName.has(redirectedPath), "duplicate redirected path");
	filesByName.set(redirectedPath, file);
	filesByName.set(path, file || false);
    }
    else {
	filesByName.set(path, file);
    }
}

@sheetalkamat
Copy link
Member

Had encountered this while working on #29262 but when it got closed in favor of #30288 this issue was missed. f2862b2 handled this then but need to figure out what would be correct approach with new PR.

@O4epegb
Copy link

O4epegb commented Apr 3, 2019

Also has this error with typescript@3.4, although I am building project through webpack, and its only happens when in watch mode, and only at first build. After initial build everything is ok, no errors. Without watch mode everything is fine too

Error: Debug Failure. False expression.
    at Object.first (/Users/.../web/node_modules/typescript/lib/typescript.js:1087:15)
    at getArgumentArityError (/Users/.../web/node_modules/typescript/lib/typescript.js:50157:32)
    at resolveCall (/Users/.../web/node_modules/typescript/lib/typescript.js:50297:41)
    at resolveCallExpression (/Users/.../web/node_modules/typescript/lib/typescript.js:50583:20)
    at resolveSignature (/Users/.../web/node_modules/typescript/lib/typescript.js:50874:28)
    at getResolvedSignature (/Users/.../web/node_modules/typescript/lib/typescript.js:50905:26)
    at checkCallExpression (/Users/.../web/node_modules/typescript/lib/typescript.js:50992:29)
    at checkExpressionWorker (/Users/.../web/node_modules/typescript/lib/typescript.js:53047:28)
    at checkExpression (/Users/.../web/node_modules/typescript/lib/typescript.js:52969:38)
    at checkBinaryLikeExpression (/Users/.../web/node_modules/typescript/lib/typescript.js:52330:29)

Not sure how else I can help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fixed A PR has been merged for this issue Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects")
Projects
None yet
Development

No branches or pull requests

6 participants