Skip to content

StaticArray.slice: ERROR TS2304: Cannot find name 'T'. #2446

Closed
@ckaznocha

Description

@ckaznocha

While updating from v0.20.18 to v0.20.19 I started getting a TS error from staticarray.ts

ERROR TS2304: Cannot find name 'T'.
     :
 235 │ slice<U extends ArrayLike<T> = Array<T>>(start: i32 = 0, end: i32 = i32.MAX_VALUE): U {
     │                                      ~
     └─ in ~lib/staticarray.ts(235,40)

I suspect this may be related to #2404.

I have some functions that slice a StaticArray. A simple example may be something like:

export function foo(a: StaticArray<string>): string[] {
  const result = a.slice(0);
  // push some things onto "result"
  return result;
}

With v0.20.18 I would not get any TS errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions