-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
TypeScript Version: 2.4.2
Code
For this JavaScript with checkJs
enabled:
// @ts-check
/**
* @type {HTMLImageElement}
*/
const el = document.querySelector("#definitelyAnImage");
el.src = "image.png";
Expected behavior:
Can cast result of document.querySelector
which returns an Element
to an HTMLImageElement
Actual behavior:
Error:
file: 'file:///Users/matb/projects/san/a.js'
severity: 'Error'
message: 'Type 'Element' is not assignable to type 'HTMLImageElement'.
Property 'align' is missing in type 'Element'.'
at: '5,7'
source: 'js'
niedzielski
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue