Skip to content

Can't infer unique symbol types via another variable #35896

Open
@falsandtru

Description

@falsandtru

Literals such as 0 can be inferred correctly but unique symbols are not.

TypeScript Version: 3.7.x-dev.20191224

Search Terms:

Code

let revision: symbol;
const rev = revision = Symbol();
rev === revision;

Expected behavior:
Type rev is unique symbol.
Actual behavior:
Type rev is symbol. Can't even declare that rev is a unique symbol.
Playground Link: https://www.typescriptlang.org/play/index.html?ts=3.8.0-dev.20191224&ssl=1&ssc=1&pln=3&pc=18#code/DYUwLgBATiBuCWBneB7AdgLgogngWwCMVgBuAKAGN1FIZYIBeaOJVNRiAZXyOAAoAlOTqMGTOq3QkgA

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions