Skip to content

Commit 95b3d6b

Browse files
committed
Adding test
1 parent a21460f commit 95b3d6b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tests/cases/conformance/es6/destructuring/restElementWithNullInitializer.ts(1,14): error TS2461: Type 'null' is not an array type.
2+
3+
4+
==== tests/cases/conformance/es6/destructuring/restElementWithNullInitializer.ts (1 errors) ====
5+
function foo([...r] = null) { }
6+
~~~~~~
7+
!!! error TS2461: Type 'null' is not an array type.
8+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//// [restElementWithNullInitializer.ts]
2+
function foo([...r] = null) { }
3+
4+
5+
//// [restElementWithNullInitializer.js]
6+
function foo(_a) { }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function foo([...r] = null) { }

0 commit comments

Comments
 (0)