Skip to content

Import resolution issue on entire module importing #438

Description

@Meterius

Imports using entire module imports (using import * as ...) cause runtyping to import the types from the file that contains the import and not the file that is exporting.

Example:

common.ts

export enum Status { 
  Paused,
  Running
}

test.ts

import * as common from "./common";

export interface ExampleA {
  status: common.Status;
}

If runtypes are generated for ExampleA in test.ts, the generated file
will attempt to import Status from test.ts instead of common.ts. If we
instead imported Status directly from common.ts it would correctly import
Status from common.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    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