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