Skip to content

Bug in type of RegExpMatchArray/RegExpExecArray #17094

@abramobagnara

Description

@abramobagnara

TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)

Expected behavior:

From ECMA specification it should be:

interface RegExpMatchArray extends Array<string | undefined> {
    index?: number;
    input?: string;
}

interface RegExpExecArray extends Array<string | undefined> {
    index: number;
    input: string;
}

Actual behavior:

Currently is:

interface RegExpMatchArray extends Array<string> {
    index?: number;
    input?: string;
}

interface RegExpExecArray extends Array<string> {
    index: number;
    input: string;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions