Closed
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: