You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add inference priority level for conditional types in contravariant positions (#35199)
* Add inference priority level for conditional types in contravariant positions
* Accept new API baselines
* Add regression tests
* Accept new baselines
Copy file name to clipboardExpand all lines: src/compiler/types.ts
+6-5
Original file line number
Diff line number
Diff line change
@@ -4740,11 +4740,12 @@ namespace ts {
4740
4740
HomomorphicMappedType=1<<1,// Reverse inference for homomorphic mapped type
4741
4741
PartialHomomorphicMappedType=1<<2,// Partial reverse inference for homomorphic mapped type
4742
4742
MappedTypeConstraint=1<<3,// Reverse inference for mapped type
4743
-
ReturnType=1<<4,// Inference made from return type of generic function
4744
-
LiteralKeyof=1<<5,// Inference made from a string literal to a keyof T
4745
-
NoConstraints=1<<6,// Don't infer from constraints of instantiable types
4746
-
AlwaysStrict=1<<7,// Always use strict rules for contravariant inferences
4747
-
MaxValue=1<<8,// Seed for inference priority tracking
4743
+
ContravariantConditional=1<<4,// Conditional type in contravariant position
4744
+
ReturnType=1<<5,// Inference made from return type of generic function
4745
+
LiteralKeyof=1<<6,// Inference made from a string literal to a keyof T
4746
+
NoConstraints=1<<7,// Don't infer from constraints of instantiable types
4747
+
AlwaysStrict=1<<8,// Always use strict rules for contravariant inferences
4748
+
MaxValue=1<<9,// Seed for inference priority tracking
4748
4749
4749
4750
PriorityImpliesCombination=ReturnType|MappedTypeConstraint|LiteralKeyof,// These priorities imply that the resulting type should be a combination of all candidates
4750
4751
Circularity=-1,// Inference circularity (value less than all other priorities)
0 commit comments