Skip to content

Loose typing for ES6 Map/Set #9674

Description

@use-strict

TypeScript Version: 2.0.0

Code

// In lib.es2015.collection
interface MapConstructor {
    new (): Map<any, any>;
    // ...
}

Map, Set, WeakMap and WeakSet have unsafe constructor signatures. This leads to implicit unwanted behavior. They should be removed, in favor of their generic counterparts. Users who want unsafe code should use explicit casts, like this: new Map<any, any>()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions