Regression to #35004 · Issue #64136 · microsoft/TypeScript · GitHub
Skip to content

Regression to #35004 #64136

Description

@valler

🔎 Search Terms

Assertion functions don't work with wildcard imports

🕗 Version & Regression Information

This changed between versions 6 or earlier and 7

⏯ Playground Link

No response

💻 Code

// foo.ts
export function f(x: any): asserts x is boolean {
  if (typeof x === "boolean") return;
  throw new Error("...");
}
// bar.ts
import * as m from "./foo.js";
const { f } = m;
f(!0);

🙁 Actual behavior

TS2775

🙂 Expected behavior

no error

Additional information about the issue

See #35004

Activity

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

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions