Skip to content

Strict Comparison Operator Doesn't Infer Singleton Types Correctly #6940

Closed
@vlad-shatskyi

Description

@vlad-shatskyi

Having a singleton type type A = "a" | "b", a variable const a: A = "a", and an expression a === "c", the compiler should infer the type of "c" as A and make the expression unsound.

Currently (1.8.0 and 1.9.0-dev.20160206) it compiles, which makes usage of singleton types instead of enums less type safe.

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