Files
tsgo/testdata/baselines/reference/submodule/compiler/arrayIndexWithArrayFails.js

11 lines
310 B
TypeScript

//// [tests/cases/compiler/arrayIndexWithArrayFails.ts] ////
//// [arrayIndexWithArrayFails.ts]
declare const arr1: (string | string[])[];
declare const arr2: number[];
const j = arr2[arr1[0]]; // should error
//// [arrayIndexWithArrayFails.js]
"use strict";
const j = arr2[arr1[0]]; // should error