Closed
Description
TypeScript Version:
1.9.0-dev (nightly)
Code
// A self-contained demonstration of the problem follows...
function <T>(arg: T|T[]) {
if (Array.isArray(arg)) {
// arg expected to be T[] here, and it has type T[] (works as expected)
} else {
// arg expected to be T here, but it is has type T|T[] (unexpected behaviour)
}
}