-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
cc @ahejlsberg
TypeScript Version: 3.7.x-dev.20191101
Search Terms:
Code
const a = document.querySelector('_')?.textContent!;
Expected behavior:
Type of a is string | undefined.
Actual behavior:
Type of a is string.
This means document.querySelector('_').textContent!
is valid and these are the equivalent to document.querySelector('_')!.textContent!
.
Related Issues:
jcalz and rohitf
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug