mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
21 lines
907 B
Plaintext
21 lines
907 B
Plaintext
logicalAssignment7.ts(10,5): error TS2532: Object is possibly 'undefined'.
|
|
logicalAssignment7.ts(10,40): error TS2345: Argument of type '100' is not assignable to parameter of type 'never'.
|
|
|
|
|
|
==== logicalAssignment7.ts (2 errors) ====
|
|
function foo1(results: number[] | undefined, results1: number[] | undefined) {
|
|
(results ||= results1 ||= []).push(100);
|
|
}
|
|
|
|
function foo2(results: number[] | undefined, results1: number[] | undefined) {
|
|
(results ??= results1 ??= []).push(100);
|
|
}
|
|
|
|
function foo3(results: number[] | undefined, results1: number[] | undefined) {
|
|
(results &&= results1 &&= []).push(100);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2532: Object is possibly 'undefined'.
|
|
~~~
|
|
!!! error TS2345: Argument of type '100' is not assignable to parameter of type 'never'.
|
|
}
|
|
|