DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.5k stars 31 forks source link

Assignment to symbols is allowed #1510

Open bbrk24 opened 5 hours ago

bbrk24 commented 5 hours ago

Why does this compile outside of a class body?

:foo = bar
bbrk24 commented 3 hours ago

Oh, I guess this makes a nonzero amount of sense for well-known symbols, like :asyncIterator ??= Symbol 'Symbol.asyncIterator' in a polyfill. But for the ones like this that compile to Symbol.for it's always an error so it shouldn't be allowed.