-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Code
// @filename: declares.d.ts
// this is the declaration for 'assert' from @types/node
export function art(value: any, message?: string | Error): asserts value;
// @filename: test.js
const { art } = require('./declares')
let x = 1
art(x)
Expected behavior:
No error.
Actual behavior:
Error: "Assertions require every name in the call target to be declared with an explicit type annotation."
There is no error when using ES imports:
// @filename: test2.js
import { art } from './declares'
let x = 1
art(x)
dsommerich, thorn0 and ExE-Boss
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue