Skip to content

Inferring return types with import attributes causes debug assertion. #56394

Closed

Description

🔎 Search Terms

infer return type import attributes

🕗 Version & Regression Information

  • This is a crash

⏯ Playground Link

Playground Link

💻 Code

// @module: NodeNext

// @filename: node_modules/inner/index.d.mts
export const esm = true;

// @filename: node_modules/inner/package.json
{ "name": "inner", "exports": { "./mjs": "./index.mjs" } }

// @filename: foo.ts
export /*a*/function/*b*/ fn() {
    return import("inner/mjs")
}

🙁 Actual behavior

Using infer return type on fn will cause a debug assertion.

🙂 Expected behavior

Should infer the return type.

Additional information about the issue

Found while working on isolated declaration.

It's caused by ImportAttributes not going through the full emit pipeline and thus not having their position assigned if they are part of an import type node.

Activity

  1. SarthakNikhal commented on Nov 16, 2023

    @SarthakNikhal

    Hey! Can I work on this issue?

  2. jakebailey commented on Nov 16, 2023

    @jakebailey
    Member
  3. locked as resolved and limited conversation to collaborators on Oct 22, 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

    Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions