Skip to content

immutable*Of(…) functions shouldn't be deprecated, and should return Immutable* instead of Persistent* #62

@rgoldberg

Description

@rgoldberg

immutable*Of(…) functions shouldn't be deprecated.

They should return Immutable* instead of Persistent*.

Currently, e.g.:

val x = immutableSetOf(1, 2, 3)
val y: ImmutableSet<Int> = immutableSetOf(1, 2, 3)

// x is PersistentSet<Int>
// y is ImmutableSet<Int>

x should be an ImmutableSet<Int>, but is a PersistentSet<Int>.

If I want an Immutable*, why force me to write an explicit type?

It's not like immutable*Of(…) functions are difficult to create or maintain…

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