Skip to content

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Jul 13, 2019

unique symbol type was added to TypeScript at v2.7. This PR adds highlight for it.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol

// Works
declare const Foo: unique symbol;

// Error! 'Bar' isn't a constant.
let Bar: unique symbol = Symbol();

// Works - refers to a unique symbol, but its identity is tied to 'Foo'.
let Baz: typeof Foo = Foo;

// Also works.
class C {
    static readonly StaticSymbol: unique symbol = Symbol();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant