Skip to content

import() of module with bad exports: TypeError: Cannot read property 'kind' of undefined at getTypeOfFuncClassEnumModule #26964

@jeffrey-easyesi

Description

@jeffrey-easyesi

TypeScript Version: 2.9.2, 3.0.3, 3.1.0-dev.201xxxxx

Search Terms: import export getTypeOfFuncClassEnumModule

Code

A.ts:

class A {}
export class B {}
export = A;
import("A");

Expected behavior:
Should give an error about the conflicting exports.

Actual behavior:

$ ~/TypeScript-3.0.3/bin/tsc -m amd A.ts 
/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:67654
                throw e;
                ^

TypeError: Cannot read property 'kind' of undefined
    at getTypeOfFuncClassEnumModule (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:27916:50)
    at getTypeOfSymbol (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:27993:24)
    at checkImportCallExpression (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:39382:96)
    at checkExpressionWorker (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:40864:32)
    at checkExpression (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:40809:42)
    at checkExpressionStatement (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:42767:13)
    at checkSourceElement (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:44426:28)
    at Object.forEach (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:168:30)
    at checkSourceFileWorker (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:44596:20)
    at checkSourceFile (/home/jeffrey/TypeScript-3.0.3/lib/tsc.js:44569:13)

Metadata

Metadata

Assignees

No one assigned

    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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions