Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Jan 15, 2021
1 parent b46ca71 commit 439c9ad
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 5,029 deletions.
2 changes: 1 addition & 1 deletion tests/baselines/reference/callChain.types
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ declare const o5: <T>() => undefined | (() => void);
>o5 : <T>() => undefined | (() => void)

o5<number>()?.();
>o5<number>()?.() : void | undefined
>o5<number>()?.() : void
>o5<number>() : (() => void) | undefined
>o5 : <T>() => (() => void) | undefined

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(112,1): error TS
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(112,1): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(130,5): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(134,1): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(148,9): error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(153,9): error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(208,9): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(211,9): error TS2532: Object is possibly 'undefined'.
Expand Down Expand Up @@ -62,7 +63,7 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(518,13): error T
tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(567,21): error TS2532: Object is possibly 'undefined'.


==== tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts (62 errors) ====
==== tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts (63 errors) ====
// assignments in shortcutting chain
declare const o: undefined | {
[key: string]: any;
Expand Down Expand Up @@ -251,6 +252,8 @@ tests/cases/conformance/controlFlow/controlFlowOptionalChain.ts(567,21): error T
}
if (!!true) {
maybeIsString?.(x);
~~~~~~~~~~~~~
!!! error TS2775: Assertions require every name in the call target to be declared with an explicit type annotation.
x;
}
if (!!true) {
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/controlFlowOptionalChain.types
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function f01(x: unknown) {
>true : true

maybeIsString?.(x);
>maybeIsString?.(x) : void | undefined
>maybeIsString?.(x) : void
>maybeIsString : ((value: unknown) => asserts value is string) | undefined
>x : unknown

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class C extends B {
>body : () => void

super.m && super.m();
>super.m && super.m() : void | undefined
>super.m && super.m() : void
>super.m : (() => void) | undefined
>super : B
>m : (() => void) | undefined
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/discriminantPropertyCheck.types
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ const u: U = {} as any;
>{} : {}

u.a && u.b && f(u.a, u.b);
>u.a && u.b && f(u.a, u.b) : void | "" | undefined
>u.a && u.b && f(u.a, u.b) : void | ""
>u.a && u.b : string | undefined
>u.a : string | undefined
>u : U
Expand All @@ -361,7 +361,7 @@ u.a && u.b && f(u.a, u.b);
>b : string

u.b && u.a && f(u.a, u.b);
>u.b && u.a && f(u.a, u.b) : void | "" | undefined
>u.b && u.a && f(u.a, u.b) : void | ""
>u.b && u.a : string | undefined
>u.b : string | undefined
>u : U
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/promiseTypeStrictNull.types
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,8 @@ const p75 = p.then(() => undefined, () => null);
>null : null

const p76 = p.then(() => undefined, () => {});
>p76 : Promise<void | undefined>
>p.then(() => undefined, () => {}) : Promise<void | undefined>
>p76 : Promise<void>
>p.then(() => undefined, () => {}) : Promise<void>
>p.then : <TResult1 = boolean, TResult2 = never>(onfulfilled?: ((value: boolean) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>
>p : Promise<boolean>
>then : <TResult1 = boolean, TResult2 = never>(onfulfilled?: ((value: boolean) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>
Expand Down Expand Up @@ -1092,8 +1092,8 @@ const p93 = p.then(() => {}, () => x);
>x : any

const p94 = p.then(() => {}, () => undefined);
>p94 : Promise<void | undefined>
>p.then(() => {}, () => undefined) : Promise<void | undefined>
>p94 : Promise<void>
>p.then(() => {}, () => undefined) : Promise<void>
>p.then : <TResult1 = boolean, TResult2 = never>(onfulfilled?: ((value: boolean) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>
>p : Promise<boolean>
>then : <TResult1 = boolean, TResult2 = never>(onfulfilled?: ((value: boolean) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/superMethodCall.types
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ class Derived extends Base {
>Base : Base

method() {
>method : () => void | undefined
>method : () => void

return super.method?.();
>super.method?.() : void | undefined
>super.method?.() : void
>super.method : (() => void) | undefined
>super : Base
>method : (() => void) | undefined
}

async asyncMethod() {
>asyncMethod : () => Promise<void | undefined>
>asyncMethod : () => Promise<void>

return super.method?.();
>super.method?.() : void | undefined
>super.method?.() : void
>super.method : (() => void) | undefined
>super : Base
>method : (() => void) | undefined
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/thisMethodCall.types
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class C {
>other : () => void

this.method?.();
>this.method?.() : void | undefined
>this.method?.() : void
>this.method : (() => void) | undefined
>this : this
>method : (() => void) | undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function test(required1: () => boolean, required2: () => boolean, b: boolean, op

// ok
optional && console.log('optional');
>optional && console.log('optional') : void | undefined
>optional && console.log('optional') : void
>optional : (() => boolean) | undefined
>console.log('optional') : void
>console.log : (...data: any[]) => void
Expand All @@ -70,7 +70,7 @@ function test(required1: () => boolean, required2: () => boolean, b: boolean, op

// ok
1 && optional && console.log('optional');
>1 && optional && console.log('optional') : void | undefined
>1 && optional && console.log('optional') : void
>1 && optional : (() => boolean) | undefined
>1 : 1
>optional : (() => boolean) | undefined
Expand Down Expand Up @@ -441,7 +441,7 @@ class Foo {

// ok
1 && this.optional && console.log('optional');
>1 && this.optional && console.log('optional') : void | undefined
>1 && this.optional && console.log('optional') : void
>1 && this.optional : (() => boolean) | undefined
>1 : 1
>this.optional : (() => boolean) | undefined
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/typeVariableTypeGuards.types
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class A<P extends Partial<Foo>> {
>doSomething : () => void

this.props.foo && this.props.foo()
>this.props.foo && this.props.foo() : void | undefined
>this.props.foo && this.props.foo() : void
>this.props.foo : P["foo"] | undefined
>this.props : Readonly<P>
>this : this
Expand Down
Loading

0 comments on commit 439c9ad

Please sign in to comment.