Update test file and baselines

This commit is contained in:
Jack Williams 2018-09-13 11:44:19 +01:00
parent 267e5989cd
commit 1f2338bd78
4 changed files with 54 additions and 47 deletions

View file

@ -13,7 +13,7 @@ if (u === 5) {
const y = u.toString(10);
}
if (u === true || u === false) {
if (u === true || u === false) {
const someBool: boolean = u;
}
@ -25,29 +25,30 @@ if (u === null) {
const someNull: null = u;
}
if(u === symb) {
if (u === symb) {
const symbolAlias: typeof symb = u;
}
if (!(u === 42)) {
u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>
}
if (u !== 42) {
type A = isTrue<isUnknown<typeof u>>
}
if (u == 42) {
type B = isTrue<isUnknown<typeof u>>
}
if (u == true) {
if (u == 42) {
type C = isTrue<isUnknown<typeof u>>
}
if (u == Object) {
if (u == true) {
type D = isTrue<isUnknown<typeof u>>
}
if (u == Object) {
type E = isTrue<isUnknown<typeof u>>
}
//// [unknownType2.js]
@ -70,7 +71,6 @@ if (u === symb) {
var symbolAlias = u;
}
if (!(u === 42)) {
u; // u should still be `unknown` here
}
if (u !== 42) {
}

View file

@ -38,7 +38,7 @@ if (u === 5) {
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
}
if (u === true || u === false) {
if (u === true || u === false) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@ -64,7 +64,7 @@ if (u === null) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
}
if(u === symb) {
if (u === symb) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
>symb : Symbol(symb, Decl(unknownType2.ts, 8, 13))
@ -77,15 +77,19 @@ if(u === symb) {
if (!(u === 42)) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>
>A : Symbol(A, Decl(unknownType2.ts, 30, 18))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
}
if (u !== 42) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
type A = isTrue<isUnknown<typeof u>>
>A : Symbol(A, Decl(unknownType2.ts, 34, 15))
type B = isTrue<isUnknown<typeof u>>
>B : Symbol(B, Decl(unknownType2.ts, 35, 15))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@ -94,8 +98,8 @@ if (u !== 42) {
if (u == 42) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
type B = isTrue<isUnknown<typeof u>>
>B : Symbol(B, Decl(unknownType2.ts, 38, 14))
type C = isTrue<isUnknown<typeof u>>
>C : Symbol(C, Decl(unknownType2.ts, 39, 14))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@ -104,8 +108,8 @@ if (u == 42) {
if (u == true) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
type C = isTrue<isUnknown<typeof u>>
>C : Symbol(C, Decl(unknownType2.ts, 42, 16))
type D = isTrue<isUnknown<typeof u>>
>D : Symbol(D, Decl(unknownType2.ts, 43, 16))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
@ -115,8 +119,8 @@ if (u == Object) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
type D = isTrue<isUnknown<typeof u>>
>D : Symbol(D, Decl(unknownType2.ts, 46, 18))
type E = isTrue<isUnknown<typeof u>>
>E : Symbol(E, Decl(unknownType2.ts, 47, 18))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

View file

@ -49,7 +49,7 @@ if (u === 5) {
>10 : 10
}
if (u === true || u === false) {
if (u === true || u === false) {
>u === true || u === false : boolean
>u === true : boolean
>u : unknown
@ -84,7 +84,7 @@ if (u === null) {
>u : null
}
if(u === symb) {
if (u === symb) {
>u === symb : boolean
>u : unknown
>symb : unique symbol
@ -102,23 +102,15 @@ if (!(u === 42)) {
>u : unknown
>42 : 42
u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>
>A : true
>u : unknown
}
if (u !== 42) {
>u !== 42 : boolean
>u : unknown
>42 : 42
type A = isTrue<isUnknown<typeof u>>
>A : true
>u : unknown
}
if (u == 42) {
>u == 42 : boolean
>u : unknown
>42 : 42
type B = isTrue<isUnknown<typeof u>>
@ -126,13 +118,23 @@ if (u == 42) {
>u : unknown
}
if (u == 42) {
>u == 42 : boolean
>u : unknown
>42 : 42
type C = isTrue<isUnknown<typeof u>>
>C : true
>u : unknown
}
if (u == true) {
>u == true : boolean
>u : unknown
>true : true
type C = isTrue<isUnknown<typeof u>>
>C : true
type D = isTrue<isUnknown<typeof u>>
>D : true
>u : unknown
}
@ -141,8 +143,8 @@ if (u == Object) {
>u : unknown
>Object : ObjectConstructor
type D = isTrue<isUnknown<typeof u>>
>D : true
type E = isTrue<isUnknown<typeof u>>
>E : true
>u : unknown
}

View file

@ -14,7 +14,7 @@ if (u === 5) {
const y = u.toString(10);
}
if (u === true || u === false) {
if (u === true || u === false) {
const someBool: boolean = u;
}
@ -26,26 +26,27 @@ if (u === null) {
const someNull: null = u;
}
if(u === symb) {
if (u === symb) {
const symbolAlias: typeof symb = u;
}
if (!(u === 42)) {
u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>
}
if (u !== 42) {
type A = isTrue<isUnknown<typeof u>>
}
if (u == 42) {
type B = isTrue<isUnknown<typeof u>>
}
if (u == true) {
if (u == 42) {
type C = isTrue<isUnknown<typeof u>>
}
if (u == Object) {
if (u == true) {
type D = isTrue<isUnknown<typeof u>>
}
if (u == Object) {
type E = isTrue<isUnknown<typeof u>>
}