Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Oct 19, 2021
1 parent 9ea685b commit 75ab347
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(12,20): error TS2345: Argument of type '"value"' is not assignable to parameter of type 'XX extends XX ? "value" : never'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(28,20): error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(29,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(33,22): error TS2345: Argument of type 'T | null' is not assignable to parameter of type 'null extends T | null ? any : never'.
Type 'null' is not assignable to type 'null extends T | null ? any : never'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(34,23): error TS2345: Argument of type 'T | null' is not assignable to parameter of type '[null] extends [T | null] ? any : never'.
Type 'null' is not assignable to type '[null] extends [T | null] ? any : never'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(39,3): error TS2322: Type '{ x: T; y: T; }' is not assignable to type 'T extends T ? { x: T; y: T; } : never'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(46,3): error TS2322: Type 'string' is not assignable to type 'Foo<T>'.
tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(63,9): error TS2322: Type '{ a: number; b: number; }' is not assignable to type '[T] extends [[infer U]] ? U : { b: number; }'.
Expand All @@ -10,7 +15,7 @@ tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(116,3): error T
Type '(arg: any) => any' is not assignable to type 'InferBecauseWhyNotDistributive<Q>'.


==== tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts (8 errors) ====
==== tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts (11 errors) ====
export type FilterPropsByType<T, TT> = {
[K in keyof T]: T[K] extends TT ? K : never
}[keyof T];
Expand All @@ -23,6 +28,8 @@ tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(116,3): error T

export function func<XX extends string>(x: XX, tipos: { value: XX }[]) {
select(x, tipos, "value");
~~~~~~~
!!! error TS2345: Argument of type '"value"' is not assignable to parameter of type 'XX extends XX ? "value" : never'.
}

declare function onlyNullablePlease<T extends null extends T ? any : never>(
Expand All @@ -48,7 +55,13 @@ tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts(116,3): error T
function f<T>(t: T) {
var x: T | null = Math.random() > 0.5 ? null : t;
onlyNullablePlease(x); // should work
~
!!! error TS2345: Argument of type 'T | null' is not assignable to parameter of type 'null extends T | null ? any : never'.
!!! error TS2345: Type 'null' is not assignable to type 'null extends T | null ? any : never'.
onlyNullablePlease2(x); // should work
~
!!! error TS2345: Argument of type 'T | null' is not assignable to parameter of type '[null] extends [T | null] ? any : never'.
!!! error TS2345: Type 'null' is not assignable to type '[null] extends [T | null] ? any : never'.
}

function f2<T>(t1: { x: T; y: T }, t2: T extends T ? { x: T; y: T } : never) {
Expand Down

0 comments on commit 75ab347

Please sign in to comment.