25 lines
1 KiB
Text
25 lines
1 KiB
Text
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithArrayUnion.ts ===
|
|
class Message {
|
|
>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
|
|
|
|
value: string;
|
|
>value : Symbol(value, Decl(TypeGuardWithArrayUnion.ts, 0, 15))
|
|
}
|
|
|
|
function saySize(message: Message | Message[]) {
|
|
>saySize : Symbol(saySize, Decl(TypeGuardWithArrayUnion.ts, 2, 1))
|
|
>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
|
|
>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
|
|
>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
|
|
|
|
if (message instanceof Array) {
|
|
>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
|
|
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
|
|
|
|
return message.length; // Should have type Message[] here
|
|
>message.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
|
>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
|
|
>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
|
|
}
|
|
}
|
|
|