You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mangling interface bindings to indicate identifier type #61710
[Product] is already working syntax and means a tuple with exactly one element.
You can write Array<Product> instead, which is very clear if the other syntax confuses you.
It imples that there is an interface definition: interface Product[] {...};
It really doesn't, because [] are not valid identifier characters.
The notation doesn't accurately reflect the element type of the engineers array, or what the [] applies to.
I mean.. it does. The [] always applies to the type before. Honestly, if basic syntax (that is fairly common in a lot of languages) is so troublesome to you, you'll likely going to have a bad time. Better learn the syntax and get used to it.
Activity
MartinJohns commentedon May 16, 2025
[Product]is already working syntax and means a tuple with exactly one element.You can write
Array<Product>instead, which is very clear if the other syntax confuses you.It really doesn't, because
[]are not valid identifier characters.I mean.. it does. The
[]always applies to the type before. Honestly, if basic syntax (that is fairly common in a lot of languages) is so troublesome to you, you'll likely going to have a bad time. Better learn the syntax and get used to it.snarbles2 commentedon May 16, 2025
This sort of syntax is hardly unique to Typescript. It would look familiar to someone coming from one of many other typed languages.
RyanCavanaugh commentedon May 16, 2025
We can't change the syntax fundamentals of a programming language a dozen years after its creation, sorry.