Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Feb 5, 2022
1 parent f269f42 commit 1312e8a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.t
Type '{ type: T; localChannelId: string; }' is not assignable to type 'Pick<ChannelOfType<T, TextChannel> | ChannelOfType<T, EmailChannel>, "type">'.
Types of property 'type' are incompatible.
Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
Type '"text"' is not assignable to type 'T & "text"'.
Type '"text"' is not assignable to type 'T'.
'"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
Type 'T' is not assignable to type 'T & "text"'.
Type 'T' is not assignable to type '"text"'.
Type '"text" | "email"' is not assignable to type '"text"'.
Type '"email"' is not assignable to type '"text"'.
Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
Type '"text"' is not assignable to type 'T & "text"'.
Type 'T' is not assignable to type 'T & "text"'.
Type '"text" | "email"' is not assignable to type 'T & "text"'.
Type '"text"' is not assignable to type 'T & "text"'.
Type '"text"' is not assignable to type 'T'.
'"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
Type 'T' is not assignable to type '"text"'.
Type '"text" | "email"' is not assignable to type '"text"'.
Type '"email"' is not assignable to type '"text"'.


==== tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.ts (1 errors) ====
Expand Down Expand Up @@ -53,16 +58,21 @@ tests/cases/compiler/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.t
!!! error TS2322: Type '{ type: T; localChannelId: string; }' is not assignable to type 'Pick<ChannelOfType<T, TextChannel> | ChannelOfType<T, EmailChannel>, "type">'.
!!! error TS2322: Types of property 'type' are incompatible.
!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"] & ChannelOfType<T, EmailChannel>["type"]'.
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'.
!!! error TS2322: Type 'T' is not assignable to type '"text"'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'.
!!! error TS2322: Type '"email"' is not assignable to type '"text"'.
!!! error TS2322: Type 'T' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
!!! error TS2322: Type '"text"' is not assignable to type 'ChannelOfType<T, TextChannel>["type"]'.
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
!!! error TS2322: Type 'T' is not assignable to type 'T & "text"'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type 'T & "text"'.
!!! error TS2322: Type '"text"' is not assignable to type 'T & "text"'.
!!! error TS2322: Type '"text"' is not assignable to type 'T'.
!!! error TS2322: '"text"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '"text" | "email"'.
!!! error TS2322: Type 'T' is not assignable to type '"text"'.
!!! error TS2322: Type '"text" | "email"' is not assignable to type '"text"'.
!!! error TS2322: Type '"email"' is not assignable to type '"text"'.
}

const newTextChannel = makeNewChannel('text');
Expand Down
8 changes: 6 additions & 2 deletions tests/baselines/reference/indexedAccessRelation.errors.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
tests/cases/compiler/indexedAccessRelation.ts(16,23): error TS2345: Argument of type '{ a: T; }' is not assignable to parameter of type 'Pick<S & State<T>, "a">'.
Types of property 'a' are incompatible.
Type 'T' is not assignable to type 'S["a"] & T'.
Type 'T' is not assignable to type 'S["a"]'.
Type 'Foo' is not assignable to type 'S["a"] & T'.
Type 'Foo' is not assignable to type 'S["a"]'.
Type 'T' is not assignable to type 'S["a"]'.
Type 'Foo' is not assignable to type 'S["a"]'.


==== tests/cases/compiler/indexedAccessRelation.ts (1 errors) ====
Expand All @@ -26,8 +28,10 @@ tests/cases/compiler/indexedAccessRelation.ts(16,23): error TS2345: Argument of
!!! error TS2345: Argument of type '{ a: T; }' is not assignable to parameter of type 'Pick<S & State<T>, "a">'.
!!! error TS2345: Types of property 'a' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type 'S["a"] & T'.
!!! error TS2345: Type 'T' is not assignable to type 'S["a"]'.
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"] & T'.
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"]'.
!!! error TS2345: Type 'T' is not assignable to type 'S["a"]'.
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"]'.
}
}

18 changes: 12 additions & 6 deletions tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(73,5): error
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(74,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(82,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
Type 'keyof T' is not assignable to type 'keyof U'.
Type 'string | number | symbol' is not assignable to type 'keyof U'.
Type 'string' is not assignable to type 'keyof U'.
Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
Type 'string' is not assignable to type 'keyof T & keyof U'.
Type 'string' is not assignable to type 'keyof T'.
Type 'keyof T' is not assignable to type 'keyof U'.
Type 'string | number | symbol' is not assignable to type 'keyof U'.
Type 'string' is not assignable to type 'keyof U'.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(83,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(86,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
Expand Down Expand Up @@ -200,9 +203,12 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error
~~
!!! error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof T & keyof U'.
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof U'.
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof U'.
!!! error TS2322: Type 'string' is not assignable to type 'keyof U'.
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof T & keyof U'.
!!! error TS2322: Type 'string' is not assignable to type 'keyof T & keyof U'.
!!! error TS2322: Type 'string' is not assignable to type 'keyof T'.
!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof U'.
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof U'.
!!! error TS2322: Type 'string' is not assignable to type 'keyof U'.
k1 = k4; // Error
~~
!!! error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'.
Expand Down

0 comments on commit 1312e8a

Please sign in to comment.