You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exporttypeTypedArray=Int32Array|Uint8Array;exportfunctionisTypedArray(a: {}): a is Int32Array|Uint8Array{returnainstanceofInt32Array||ainstanceofUint8Array;}exportfunctionflatten<Textendsnumber|TypedArray>(arr: T){if(isTypedArray(arr)){arr[1];// TS 7053}}
Element implicitly has an 'any' type because expression of type '1' can't be used to index type '(T & Int32Array) | (T & Uint8Array)'.
Property '1' does not exist on type '(T & Int32Array) | (T & Uint8Array)'.(7053)
amcasey
changed the title
New error in 3.9: TS 7503 - can't index with number
New error in 3.9: TS 7053 - can't index with number
Apr 22, 2020
TypeScript Version: 3.9.0-dev.20200420
Search Terms:
Intersection, Union, 7053
Code
3.8 behavior: No error
3.9 behavior: Error
Playground Link: https://www.typescriptlang.org/play/?ts=3.9.0-dev.20200420&ssl=1&ssc=1&pln=11&pc=2#code/KYDwDg9gTgLgBDAnmYcAqzgBMCCUoCGicAvHAJIB2MAzAEx6HEA+cAqgJbUAcjRA3AChBoSLDgAzAK6UAxjA4RKcDgGcMKXPiIAKAgC44AbwC+ASkMEVqitXp8W7LjF7biRwXDhRgMKVGUrLlUYAjlgCAlbWgY3OGZWIMoQsNkIqM4eByETYVFoeGk5BSVJABsCGBhgSgAeNDhQasosG0opAFsAI2AoZg1sBwA+PXxDNDNjTxUonTUBrSZRqDNJjy8NuAJ8AG0ARgBdIS9ckyA
Related Issues: I'm guessing this is another empty intersection bug, but I wasn't sure how to de-dup it.
Inspiration is from https://github.com/tensorflow/tfjs/blob/95995e7fec478e86b4baf0d34f902d3e345ee54b/tfjs-core/src/util.ts#L144
The text was updated successfully, but these errors were encountered: