Skip to content

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

Closed

Description

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)

Activity

  1. ghost added
    BugA bug in TypeScript
    on Sep 7, 2018
  2. ghost closed this as completedin #26973on Sep 13, 2018
  3. ghost added
    FixedA PR has been merged for this issue
    on Sep 13, 2018
  4. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions