@@ -180,46 +180,51 @@ export const enum AssignTypeFlags {
180180 // whether overload signatures overlap.
181181 OverloadOverlapCheck = 1 << 4 ,
182182
183+ // When used in conjunction with OverloadOverlapCheck, look
184+ // for partial overlaps. For example, `int | list` overlaps
185+ // partially with `int | str`.
186+ PartialOverloadOverlapCheck = 1 << 5 ,
187+
183188 // For function types, skip the return type check.
184- SkipFunctionReturnTypeCheck = 1 << 5 ,
189+ SkipFunctionReturnTypeCheck = 1 << 6 ,
185190
186191 // Allow bool values to be assigned to TypeGuard[x] types.
187- AllowBoolTypeGuard = 1 << 6 ,
192+ AllowBoolTypeGuard = 1 << 7 ,
188193
189194 // In most cases, literals are stripped when assigning to a
190195 // type variable. This overrides the standard behavior.
191- RetainLiteralsForTypeVar = 1 << 7 ,
196+ RetainLiteralsForTypeVar = 1 << 8 ,
192197
193198 // When validating the type of a self or cls parameter, allow
194199 // a type mismatch. This is used in overload consistency validation
195200 // because overloads can provide explicit type annotations for self
196201 // or cls.
197- SkipSelfClsTypeCheck = 1 << 8 ,
202+ SkipSelfClsTypeCheck = 1 << 9 ,
198203
199204 // If an assignment is made to a TypeVar that is out of scope,
200205 // do not generate an error. This is used for populating the
201206 // typeVarContext when handling contravariant parameters in a callable.
202- IgnoreTypeVarScope = 1 << 9 ,
207+ IgnoreTypeVarScope = 1 << 10 ,
203208
204209 // We're initially populating the typeVarContext with an expected type,
205210 // so TypeVars should match the specified type exactly rather than
206211 // employing narrowing or widening, and don't strip literals.
207- PopulatingExpectedType = 1 << 10 ,
212+ PopulatingExpectedType = 1 << 11 ,
208213
209214 // Used with PopulatingExpectedType, this flag indicates that a TypeVar
210215 // constraint that is Unknown should be ignored.
211- SkipPopulateUnknownExpectedType = 1 << 11 ,
216+ SkipPopulateUnknownExpectedType = 1 << 12 ,
212217
213218 // Normally, when a class type is assigned to a TypeVar and that class
214219 // hasn't previously been specialized, it will be specialized with
215220 // default type arguments (typically "Unknown"). This flag skips
216221 // this step.
217- AllowUnspecifiedTypeArguments = 1 << 12 ,
222+ AllowUnspecifiedTypeArguments = 1 << 13 ,
218223
219224 // PEP 544 says that if the dest type is a type[Proto] class,
220225 // the source must be a "concrete" (non-protocol) class. This
221226 // flag skips this check.
222- IgnoreProtocolAssignmentCheck = 1 << 13 ,
227+ IgnoreProtocolAssignmentCheck = 1 << 14 ,
223228}
224229
225230export interface ApplyTypeVarOptions {
0 commit comments