Skip to content

Debug Failure. False expression: isDeclarationVisible unknown: SyntaxKind: 209 #2221

@csnover

Description

@csnover
// A.ts
class A {}
export = A;
// B.ts
import A from './A';
export function getA(): A { return null; }

Command: tsd -m amd -t es5 -d B.ts

Expected: No error
Actual: Crash

Error: Debug Failure. False expression: isDeclarationVisible unknown: SyntaxKind: 204
    at Object.assert (/srv/devel/web/typescript/bin/tsc.js:601:23)
    at Object.fail (/srv/devel/web/typescript/bin/tsc.js:606:19)
    at determineIfDeclarationIsVisible (/srv/devel/web/typescript/bin/tsc.js:8884:34)
    at isDeclarationVisible (/srv/devel/web/typescript/bin/tsc.js:8890:41)
    at getIsDeclarationVisible (/srv/devel/web/typescript/bin/tsc.js:8321:22)
    at /srv/devel/web/typescript/bin/tsc.js:8316:82
    at Object.forEach (/srv/devel/web/typescript/bin/tsc.js:36:30)
    at hasVisibleDeclarations (/srv/devel/web/typescript/bin/tsc.js:8316:20)
    at Object.isEntityNameVisible (/srv/devel/web/typescript/bin/tsc.js:8355:31)
    at emitEntityName (/srv/devel/web/typescript/bin/tsc.js:17361:49)

Function signature emitter for declarations seems to not understand import types so is failing on the return type of the function getA. This happens even with PR #2197 applied. There is no crash if -d is not used.

Version: Arnavion/typescript-github#2015-03-05-b784a4212aeb5a4e42a598a8613a0538ac241123

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions