f4d0ea6539
* Support `target: es2020` * use CRLF * update symbols Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
45 lines
1.6 KiB
Plaintext
45 lines
1.6 KiB
Plaintext
tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts(13,5): error TS2722: Cannot invoke an object which is possibly 'undefined'.
|
|
tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts(17,12): error TS2532: Object is possibly 'undefined'.
|
|
tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts(22,12): error TS2532: Object is possibly 'undefined'.
|
|
tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts(28,5): error TS2722: Cannot invoke an object which is possibly 'undefined'.
|
|
|
|
|
|
==== tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts (4 errors) ====
|
|
function foo1 (f?: (a: number) => void) {
|
|
f ??= (a => a)
|
|
f(42)
|
|
}
|
|
|
|
function foo2 (f?: (a: number) => void) {
|
|
f ||= (a => a)
|
|
f(42)
|
|
}
|
|
|
|
function foo3 (f?: (a: number) => void) {
|
|
f &&= (a => a)
|
|
f(42)
|
|
~
|
|
!!! error TS2722: Cannot invoke an object which is possibly 'undefined'.
|
|
}
|
|
|
|
function bar1 (f?: (a: number) => void) {
|
|
f ??= (f.toString(), (a => a))
|
|
~
|
|
!!! error TS2532: Object is possibly 'undefined'.
|
|
f(42)
|
|
}
|
|
|
|
function bar2 (f?: (a: number) => void) {
|
|
f ||= (f.toString(), (a => a))
|
|
~
|
|
!!! error TS2532: Object is possibly 'undefined'.
|
|
f(42)
|
|
}
|
|
|
|
function bar3 (f?: (a: number) => void) {
|
|
f &&= (f.toString(), (a => a))
|
|
f(42)
|
|
~
|
|
!!! error TS2722: Cannot invoke an object which is possibly 'undefined'.
|
|
}
|
|
|