Skip to content

Commit

Permalink
baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
easyrider committed Sep 28, 2021
1 parent dbbc3ae commit 82904f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/baselines/reference/controlFlowOptionalChain.types
Original file line number Diff line number Diff line change
Expand Up @@ -2057,11 +2057,11 @@ while (arr[i]?.tag === "left") {

if (arr[i]?.tag === "right") {
>arr[i]?.tag === "right" : boolean
>arr[i]?.tag : "left" | "right"
>arr[i]?.tag : "left"
>arr[i] : { tag: "left" | "right"; }
>arr : { tag: "left" | "right"; }[]
>i : number
>tag : "left" | "right"
>tag : "left"
>"right" : "right"

console.log("I should ALSO be reachable");
Expand Down
10 changes: 5 additions & 5 deletions tests/baselines/reference/incrementOnNullAssertion.types
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ if (foo[x] === undefined) {
}
else {
let nu = foo[x]
>nu : number | undefined
>foo[x] : number | undefined
>nu : number
>foo[x] : number
>foo : Dictionary<number>
>x : "bar"

let n = foo[x]
>n : number | undefined
>foo[x] : number | undefined
>n : number
>foo[x] : number
>foo : Dictionary<number>
>x : "bar"

foo[x]!++
>foo[x]!++ : number
>foo[x]! : number
>foo[x] : number | undefined
>foo[x] : number
>foo : Dictionary<number>
>x : "bar"
}
Expand Down
6 changes: 2 additions & 4 deletions tests/baselines/reference/noUncheckedIndexedAccess.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ tests/cases/conformance/pedantic/noUncheckedIndexedAccess.ts(90,7): error TS2322
Type 'undefined' is not assignable to type 'string'.
tests/cases/conformance/pedantic/noUncheckedIndexedAccess.ts(98,5): error TS2322: Type 'undefined' is not assignable to type '{ [key: string]: string; a: string; b: string; }[Key]'.
Type 'undefined' is not assignable to type 'string'.
tests/cases/conformance/pedantic/noUncheckedIndexedAccess.ts(99,11): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
tests/cases/conformance/pedantic/noUncheckedIndexedAccess.ts(99,11): error TS2322: Type 'undefined' is not assignable to type 'string'.


==== tests/cases/conformance/pedantic/noUncheckedIndexedAccess.ts (31 errors) ====
Expand Down Expand Up @@ -201,8 +200,7 @@ tests/cases/conformance/pedantic/noUncheckedIndexedAccess.ts(99,11): error TS232
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
const v: string = myRecord2[key]; // Should error
~
!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'.
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
};


2 changes: 1 addition & 1 deletion tests/baselines/reference/noUncheckedIndexedAccess.types
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ const fn3 = <Key extends keyof typeof myRecord2>(key: Key) => {

const v: string = myRecord2[key]; // Should error
>v : string
>myRecord2[key] : string | undefined
>myRecord2[key] : undefined
>myRecord2 : { [key: string]: string; a: string; b: string; }
>key : Key

Expand Down

0 comments on commit 82904f0

Please sign in to comment.