Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Mar 6, 2022
1 parent 466bcb2 commit a323037
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 32 deletions.
13 changes: 6 additions & 7 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2654,14 +2654,13 @@ declare namespace ts {
ObjectLiteralPatternWithComputedProperties = 512,
ReverseMapped = 1024,
JsxAttributes = 2048,
MarkerType = 4096,
JSLiteral = 8192,
FreshLiteral = 16384,
ArrayLiteral = 32768,
JSLiteral = 4096,
FreshLiteral = 8192,
ArrayLiteral = 16384,
ClassOrInterface = 3,
ContainsSpread = 4194304,
ObjectRestType = 8388608,
InstantiationExpressionType = 16777216,
ContainsSpread = 2097152,
ObjectRestType = 4194304,
InstantiationExpressionType = 8388608,
}
export interface ObjectType extends Type {
objectFlags: ObjectFlags;
Expand Down
13 changes: 6 additions & 7 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2654,14 +2654,13 @@ declare namespace ts {
ObjectLiteralPatternWithComputedProperties = 512,
ReverseMapped = 1024,
JsxAttributes = 2048,
MarkerType = 4096,
JSLiteral = 8192,
FreshLiteral = 16384,
ArrayLiteral = 32768,
JSLiteral = 4096,
FreshLiteral = 8192,
ArrayLiteral = 16384,
ClassOrInterface = 3,
ContainsSpread = 4194304,
ObjectRestType = 8388608,
InstantiationExpressionType = 16777216,
ContainsSpread = 2097152,
ObjectRestType = 4194304,
InstantiationExpressionType = 8388608,
}
export interface ObjectType extends Type {
objectFlags: ObjectFlags;
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/bivariantInferences.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ declare const b: (string | number)[] | null[] | undefined[] | {}[];

let x = a.equalsShallow(b);
>x : Symbol(x, Decl(bivariantInferences.ts, 9, 3))
>a.equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20))
>a.equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20))
>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13))
>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20))
>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20))
>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13))

4 changes: 2 additions & 2 deletions tests/baselines/reference/bivariantInferences.types
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ declare const b: (string | number)[] | null[] | undefined[] | {}[];
let x = a.equalsShallow(b);
>x : boolean
>a.equalsShallow(b) : boolean
>a.equalsShallow : (<T>(this: readonly T[], other: readonly T[]) => boolean) | (<T>(this: readonly T[], other: readonly T[]) => boolean) | (<T>(this: readonly T[], other: readonly T[]) => boolean) | (<T>(this: readonly T[], other: readonly T[]) => boolean)
>a.equalsShallow : <T>(this: readonly T[], other: readonly T[]) => boolean
>a : (string | number)[] | null[] | undefined[] | {}[]
>equalsShallow : (<T>(this: readonly T[], other: readonly T[]) => boolean) | (<T>(this: readonly T[], other: readonly T[]) => boolean) | (<T>(this: readonly T[], other: readonly T[]) => boolean) | (<T>(this: readonly T[], other: readonly T[]) => boolean)
>equalsShallow : <T>(this: readonly T[], other: readonly T[]) => boolean
>b : (string | number)[] | null[] | undefined[] | {}[]

Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@
},
{
"text": "join",
"kind": "propertyName"
"kind": "methodName"
},
{
"text": "(",
Expand Down Expand Up @@ -5906,7 +5906,7 @@
},
{
"text": "toLocaleString",
"kind": "propertyName"
"kind": "methodName"
},
{
"text": "(",
Expand Down Expand Up @@ -5980,7 +5980,7 @@
},
{
"text": "toString",
"kind": "propertyName"
"kind": "methodName"
},
{
"text": "(",
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/sliceResultCast.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare var x: [number, string] | [number, string, string];
>x : Symbol(x, Decl(sliceResultCast.ts, 0, 11))

x.slice(1) as readonly string[];
>x.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>x.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --))
>x : Symbol(x, Decl(sliceResultCast.ts, 0, 11))
>slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --))

4 changes: 2 additions & 2 deletions tests/baselines/reference/sliceResultCast.types
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ declare var x: [number, string] | [number, string, string];
x.slice(1) as readonly string[];
>x.slice(1) as readonly string[] : readonly string[]
>x.slice(1) : (string | number)[]
>x.slice : ((start?: number, end?: number) => (string | number)[]) | ((start?: number, end?: number) => (string | number)[])
>x.slice : (start?: number, end?: number) => (string | number)[]
>x : [number, string] | [number, string, string]
>slice : ((start?: number, end?: number) => (string | number)[]) | ((start?: number, end?: number) => (string | number)[])
>slice : (start?: number, end?: number) => (string | number)[]
>1 : 1

2 changes: 1 addition & 1 deletion tests/baselines/reference/tsxUnionElementType3.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tests/cases/conformance/jsx/file.tsx(32,17): error TS2322: Type 'string' is not
let a = <RCComp x="Hi" />;
~
!!! error TS2322: Type 'string' is not assignable to type 'never'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<RC1 | RC2> & { x: number; } & { children?: ReactNode; } & { x: string; } & { children?: ReactNode; }'
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<RC1 | RC2> & { x: number; } & { children?: ReactNode; } & { x: string; }'
let a1 = <EmptyRCComp />;
let a2 = <EmptyRCComp data-prop="hello" />;
let b = <PartRCComp />
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/tsxUnionElementType4.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tests/cases/conformance/jsx/file.tsx(34,22): error TS2322: Type '{ prop: true; }
let a = <RCComp x />;
~
!!! error TS2322: Type 'boolean' is not assignable to type 'never'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<RC1 | RC2> & { x: number; } & { children?: ReactNode; } & { x: string; } & { children?: ReactNode; }'
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<RC1 | RC2> & { x: number; } & { children?: ReactNode; } & { x: string; }'
let b = <PartRCComp x={10} />
~
!!! error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<RC4> & { children?: ReactNode; }'.
Expand Down
28 changes: 23 additions & 5 deletions tests/baselines/reference/varianceMeasurement.errors.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
tests/cases/compiler/varianceMeasurement.ts(10,7): error TS2322: Type 'Foo1<string>' is not assignable to type 'Foo1<"a">'.
Type 'string' is not assignable to type '"a"'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '"a"'.
tests/cases/compiler/varianceMeasurement.ts(11,7): error TS2322: Type 'Foo1<string>' is not assignable to type 'Foo1<unknown>'.
The types of 'y.x' are incompatible between these types.
Type '(arg: string) => void' is not assignable to type '(arg: unknown) => void'.
tests/cases/compiler/varianceMeasurement.ts(21,7): error TS2322: Type 'Foo2<string>' is not assignable to type 'Foo2<"a">'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '"a"'.
Expand All @@ -9,7 +13,11 @@ tests/cases/compiler/varianceMeasurement.ts(22,7): error TS2322: Type 'Foo2<stri
Types of parameters 'arg' and 'arg' are incompatible.
Type 'unknown' is not assignable to type 'string'.
tests/cases/compiler/varianceMeasurement.ts(33,7): error TS2322: Type 'Foo3<string>' is not assignable to type 'Foo3<"a">'.
Type 'string' is not assignable to type '"a"'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '"a"'.
tests/cases/compiler/varianceMeasurement.ts(34,7): error TS2322: Type 'Foo3<string>' is not assignable to type 'Foo3<unknown>'.
The types of 'y.x' are incompatible between these types.
Type '(arg: string) => void' is not assignable to type '(arg: unknown) => void'.
tests/cases/compiler/varianceMeasurement.ts(44,7): error TS2322: Type 'Foo4<string>' is not assignable to type 'Foo4<"a">'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '"a"'.
Expand All @@ -26,7 +34,7 @@ tests/cases/compiler/varianceMeasurement.ts(75,7): error TS2322: Type 'C<unknown
Type 'number' is not assignable to type 'string'.


==== tests/cases/compiler/varianceMeasurement.ts (9 errors) ====
==== tests/cases/compiler/varianceMeasurement.ts (11 errors) ====
// The type below should be invariant in T but is measured as covariant because
// we don't analyze recursive references.

Expand All @@ -39,8 +47,13 @@ tests/cases/compiler/varianceMeasurement.ts(75,7): error TS2322: Type 'C<unknown
const f11: Foo1<'a'> = f10;
~~~
!!! error TS2322: Type 'Foo1<string>' is not assignable to type 'Foo1<"a">'.
!!! error TS2322: Type 'string' is not assignable to type '"a"'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type '"a"'.
const f12: Foo1<unknown> = f10;
~~~
!!! error TS2322: Type 'Foo1<string>' is not assignable to type 'Foo1<unknown>'.
!!! error TS2322: The types of 'y.x' are incompatible between these types.
!!! error TS2322: Type '(arg: string) => void' is not assignable to type '(arg: unknown) => void'.

// The type below is invariant in T and is measured as such.

Expand Down Expand Up @@ -75,8 +88,13 @@ tests/cases/compiler/varianceMeasurement.ts(75,7): error TS2322: Type 'C<unknown
const f31: Foo3<'a'> = f30;
~~~
!!! error TS2322: Type 'Foo3<string>' is not assignable to type 'Foo3<"a">'.
!!! error TS2322: Type 'string' is not assignable to type '"a"'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type '"a"'.
const f32: Foo3<unknown> = f30;
~~~
!!! error TS2322: Type 'Foo3<string>' is not assignable to type 'Foo3<unknown>'.
!!! error TS2322: The types of 'y.x' are incompatible between these types.
!!! error TS2322: Type '(arg: string) => void' is not assignable to type '(arg: unknown) => void'.

// The type below is invariant in T and is measured as such.

Expand Down

0 comments on commit a323037

Please sign in to comment.