Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Created Issue: Representation of union types in function signatures is confusing [961]

$
0
0
```
function foo(x, y) {}
foo(123, 'abc');
foo('abc', 123);
foo(
```
The tooltip that appears says `foo(x: number, string, y: number, string)`. So commas are used both to separate parameters, and to separate types in a union, making it hard to tell which is which at a glance. We should use some other syntax for unions - perhaps `x: number | string`.


Viewing all articles
Browse latest Browse all 4630

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>