TypeScript/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types

124 lines
6.2 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithTypeParameters.ts ===
function fn1<T, U>(t: T, u: U) {
2015-04-13 23:01:57 +02:00
>fn1 : <T, U>(t: T, u: U) => void, Symbol(fn1, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 0))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 15))
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 15))
2014-08-15 23:33:16 +02:00
var r1 = t || t;
2015-04-13 23:01:57 +02:00
>r1 : T, Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 1, 7))
2014-08-15 23:33:16 +02:00
>t || t : T
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
2014-08-15 23:33:16 +02:00
var r2: T = t || t;
2015-04-13 23:01:57 +02:00
>r2 : T, Symbol(r2, Decl(logicalOrOperatorWithTypeParameters.ts, 2, 7))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13))
2014-08-15 23:33:16 +02:00
>t || t : T
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
2014-08-15 23:33:16 +02:00
var r3 = t || u;
2015-04-13 23:01:57 +02:00
>r3 : T | U, Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 3, 7))
>t || u : T | U
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24))
2014-08-15 23:33:16 +02:00
var r4: {} = t || u;
2015-04-13 23:01:57 +02:00
>r4 : {}, Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 4, 7))
2014-10-11 02:01:28 +02:00
>t || u : T | U
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24))
2014-08-15 23:33:16 +02:00
}
function fn2<T, U/* extends T*/, V/* extends T*/>(t: T, u: U, v: V) {
2015-04-13 23:01:57 +02:00
>fn2 : <T, U, V>(t: T, u: U, v: V) => void, Symbol(fn2, Decl(logicalOrOperatorWithTypeParameters.ts, 5, 1))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 13))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15))
>V : V, Symbol(V, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 32))
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 50))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 13))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15))
>v : V, Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61))
>V : V, Symbol(V, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 32))
2014-08-15 23:33:16 +02:00
var r1 = t || u;
2015-04-13 23:01:57 +02:00
>r1 : T | U, Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 8, 7))
>t || u : T | U
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 50))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
2014-08-15 23:33:16 +02:00
//var r2: T = t || u;
var r3 = u || u;
2015-04-13 23:01:57 +02:00
>r3 : U, Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 10, 7))
2014-08-15 23:33:16 +02:00
>u || u : U
2015-04-13 23:01:57 +02:00
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
2014-08-15 23:33:16 +02:00
var r4: U = u || u;
2015-04-13 23:01:57 +02:00
>r4 : U, Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 11, 7))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15))
2014-08-15 23:33:16 +02:00
>u || u : U
2015-04-13 23:01:57 +02:00
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
2014-08-15 23:33:16 +02:00
var r5 = u || v;
2015-04-13 23:01:57 +02:00
>r5 : U | V, Symbol(r5, Decl(logicalOrOperatorWithTypeParameters.ts, 12, 7))
>u || v : U | V
2015-04-13 23:01:57 +02:00
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
>v : V, Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61))
2014-08-15 23:33:16 +02:00
var r6: {} = u || v;
2015-04-13 23:01:57 +02:00
>r6 : {}, Symbol(r6, Decl(logicalOrOperatorWithTypeParameters.ts, 13, 7))
2014-10-11 02:01:28 +02:00
>u || v : U | V
2015-04-13 23:01:57 +02:00
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55))
>v : V, Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61))
2014-08-15 23:33:16 +02:00
//var r7: T = u || v;
}
function fn3<T extends { a: string; b: string }, U extends { a: string; b: number }>(t: T, u: U) {
2015-04-13 23:01:57 +02:00
>fn3 : <T extends { a: string; b: string; }, U extends { a: string; b: number; }>(t: T, u: U) => void, Symbol(fn3, Decl(logicalOrOperatorWithTypeParameters.ts, 15, 1))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 13))
>a : string, Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 24))
>b : string, Symbol(b, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 35))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 48))
>a : string, Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 60))
>b : number, Symbol(b, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 71))
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85))
>T : T, Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 13))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90))
>U : U, Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 48))
2014-08-15 23:33:16 +02:00
var r1 = t || u;
2015-04-13 23:01:57 +02:00
>r1 : T | U, Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 18, 7))
>t || u : T | U
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90))
2014-08-15 23:33:16 +02:00
var r2: {} = t || u;
2015-04-13 23:01:57 +02:00
>r2 : {}, Symbol(r2, Decl(logicalOrOperatorWithTypeParameters.ts, 19, 7))
2014-10-11 02:01:28 +02:00
>t || u : T | U
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90))
2014-08-15 23:33:16 +02:00
var r3 = t || { a: '' };
2015-04-13 23:01:57 +02:00
>r3 : { a: string; }, Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 20, 7))
2014-08-15 23:33:16 +02:00
>t || { a: '' } : { a: string; }
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85))
2014-08-15 23:33:16 +02:00
>{ a: '' } : { a: string; }
2015-04-13 23:01:57 +02:00
>a : string, Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 20, 19))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var r4: { a: string } = t || u;
2015-04-13 23:01:57 +02:00
>r4 : { a: string; }, Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 21, 7))
>a : string, Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 21, 13))
2014-10-11 02:01:28 +02:00
>t || u : T | U
2015-04-13 23:01:57 +02:00
>t : T, Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85))
>u : U, Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90))
2014-08-15 23:33:16 +02:00
}