Skip to content

Readonly<TypedArray> lacks Symbol propertiesΒ #42681

Closed
@ghost

Description

Bug Report

πŸ”Ž Search Terms

readonly, missing symbol property, readonly typedarray

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

const broken: Readonly<Uint8Array> = Uint8Array.of(1, 2, 3, 4);

broken[Symbol.iterator] // non-existant

const working: Uint8Array = Uint8Array.of(1, 2, 3, 4);

working[Symbol.iterator] // okay

πŸ™ Actual behavior

TS claims that Symbol.iterator and Symbol.toStringTag do not exist on Readonly.

πŸ™‚ Expected behavior

Code transpiled without error, Symbol.iterator has the same type on Readonly as it does on Uint8Array.

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