diff --git a/mypy/fastparse.py b/mypy/fastparse.py
--- a/mypy/fastparse.py
+++ b/mypy/fastparse.py
@@ -496,18 +496,9 @@ def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:
             if_overload_name: Optional[str] = None
             if_block_with_overload: Optional[Block] = None
             if_unknown_truth_value: Optional[IfStmt] = None
-            if (
-                isinstance(stmt, IfStmt)
-                and len(stmt.body[0].body) == 1
-                and seen_unconditional_func_def is False
-                and (
-                    isinstance(stmt.body[0].body[0], (Decorator, OverloadedFuncDef))
-                    or current_overload_name is not None
-                    and isinstance(stmt.body[0].body[0], FuncDef)
-                )
-            ):
+            if isinstance(stmt, IfStmt) and seen_unconditional_func_def is False:
                 # Check IfStmt block to determine if function overloads can be merged
-                if_overload_name = self._check_ifstmt_for_overloads(stmt)
+                if_overload_name = self._check_ifstmt_for_overloads(stmt, current_overload_name)
                 if if_overload_name is not None:
                     if_block_with_overload, if_unknown_truth_value = \
                         self._get_executable_if_block_with_overloads(stmt)
@@ -553,8 +544,11 @@ def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:
                     else:
                         current_overload.append(last_if_overload)
                     last_if_stmt, last_if_overload = None, None
-                if isinstance(if_block_with_overload.body[0], OverloadedFuncDef):
-                    current_overload.extend(if_block_with_overload.body[0].items)
+                if isinstance(if_block_with_overload.body[-1], OverloadedFuncDef):
+                    skipped_if_stmts.extend(
+                        cast(List[IfStmt], if_block_with_overload.body[:-1])
+                    )
+                    current_overload.extend(if_block_with_overload.body[-1].items)
                 else:
                     current_overload.append(
                         cast(Union[Decorator, FuncDef], if_block_with_overload.body[0])
@@ -600,9 +594,12 @@ def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:
                     last_if_stmt = stmt
                     last_if_stmt_overload_name = None
                     if if_block_with_overload is not None:
+                        skipped_if_stmts.extend(
+                            cast(List[IfStmt], if_block_with_overload.body[:-1])
+                        )
                         last_if_overload = cast(
                             Union[Decorator, FuncDef, OverloadedFuncDef],
-                            if_block_with_overload.body[0]
+                            if_block_with_overload.body[-1]
                         )
                     last_if_unknown_truth_value = if_unknown_truth_value
                 else:
@@ -620,11 +617,15 @@ def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:
             ret.append(current_overload[0])
         elif len(current_overload) > 1:
             ret.append(OverloadedFuncDef(current_overload))
+        elif last_if_overload is not None:
+            ret.append(last_if_overload)
         elif last_if_stmt is not None:
             ret.append(last_if_stmt)
         return ret
 
-    def _check_ifstmt_for_overloads(self, stmt: IfStmt) -> Optional[str]:
+    def _check_ifstmt_for_overloads(
+        self, stmt: IfStmt, current_overload_name: Optional[str] = None
+    ) -> Optional[str]:
         """Check if IfStmt contains only overloads with the same name.
         Return overload_name if found, None otherwise.
         """
@@ -632,11 +633,22 @@ def _check_ifstmt_for_overloads(self, stmt: IfStmt) -> Optional[str]:
         # Multiple overloads have already been merged as OverloadedFuncDef.
         if not (
             len(stmt.body[0].body) == 1
-            and isinstance(stmt.body[0].body[0], (Decorator, FuncDef, OverloadedFuncDef))
+            and (
+                isinstance(stmt.body[0].body[0], (Decorator, OverloadedFuncDef))
+                or current_overload_name is not None
+                and isinstance(stmt.body[0].body[0], FuncDef)
+            )
+            or len(stmt.body[0].body) > 1
+            and isinstance(stmt.body[0].body[-1], OverloadedFuncDef)
+            and all(
+                self._is_stripped_if_stmt(if_stmt)
+                for if_stmt in stmt.body[0].body[:-1]
+            )
         ):
             return None
 
-        overload_name = stmt.body[0].body[0].name
+        overload_name = cast(
+            Union[Decorator, FuncDef, OverloadedFuncDef], stmt.body[0].body[-1]).name
         if stmt.else_body is None:
             return overload_name
 
@@ -649,7 +661,9 @@ def _check_ifstmt_for_overloads(self, stmt: IfStmt) -> Optional[str]:
                 return overload_name
             if (
                 isinstance(stmt.else_body.body[0], IfStmt)
-                and self._check_ifstmt_for_overloads(stmt.else_body.body[0]) == overload_name
+                and self._check_ifstmt_for_overloads(
+                    stmt.else_body.body[0], current_overload_name
+                ) == overload_name
             ):
                 return overload_name
 
@@ -704,6 +718,25 @@ def _strip_contents_from_if_stmt(self, stmt: IfStmt) -> None:
             else:
                 stmt.else_body.body = []
 
+    def _is_stripped_if_stmt(self, stmt: Statement) -> bool:
+        """Check stmt to make sure it is a stripped IfStmt.
+
+        See also: _strip_contents_from_if_stmt
+        """
+        if not isinstance(stmt, IfStmt):
+            return False
+
+        if not (len(stmt.body) == 1 and len(stmt.body[0].body) == 0):
+            # Body not empty
+            return False
+
+        if not stmt.else_body or len(stmt.else_body.body) == 0:
+            # No or empty else_body
+            return True
+
+        # For elif, IfStmt are stored recursively in else_body
+        return self._is_stripped_if_stmt(stmt.else_body.body[0])
+
     def in_method_scope(self) -> bool:
         return self.class_and_function_stack[-2:] == ['C', 'F']
 

diff --git a/test-data/unit/check-overloading.test b/test-data/unit/check-overloading.test
--- a/test-data/unit/check-overloading.test
+++ b/test-data/unit/check-overloading.test
@@ -6349,3 +6349,142 @@ def g(x: int) -> str: ...
 
 def g(x: int = 0) -> int:  # E: Overloaded function implementation cannot produce return type of signature 2
     return x
+
+[case testOverloadIfNestedOk]
+# flags: --always-true True --always-false False
+from typing import overload
+
+class A: ...
+class B: ...
+class C: ...
+class D: ...
+
+@overload
+def f1(g: A) -> A: ...
+if True:
+    @overload
+    def f1(g: B) -> B: ...
+    if True:
+        @overload
+        def f1(g: C) -> C: ...
+        @overload
+        def f1(g: D) -> D: ...
+def f1(g): ...
+reveal_type(f1(A()))  # N: Revealed type is "__main__.A"
+reveal_type(f1(B()))  # N: Revealed type is "__main__.B"
+reveal_type(f1(C()))  # N: Revealed type is "__main__.C"
+reveal_type(f1(D()))  # N: Revealed type is "__main__.D"
+
+@overload
+def f2(g: A) -> A: ...
+if True:
+    @overload
+    def f2(g: B) -> B: ...
+    if True:
+        @overload
+        def f2(g: C) -> C: ...
+        if True:
+            @overload
+            def f2(g: D) -> D: ...
+def f2(g): ...
+reveal_type(f2(A()))  # N: Revealed type is "__main__.A"
+reveal_type(f2(B()))  # N: Revealed type is "__main__.B"
+reveal_type(f2(C()))  # N: Revealed type is "__main__.C"
+reveal_type(f2(D()))  # N: Revealed type is "__main__.D"
+
+@overload
+def f3(g: A) -> A: ...
+if True:
+    if True:
+        @overload
+        def f3(g: B) -> B: ...
+    if True:
+        @overload
+        def f3(g: C) -> C: ...
+def f3(g): ...
+reveal_type(f3(A()))  # N: Revealed type is "__main__.A"
+reveal_type(f3(B()))  # N: Revealed type is "__main__.B"
+reveal_type(f3(C()))  # N: Revealed type is "__main__.C"
+
+@overload
+def f4(g: A) -> A: ...
+if True:
+    if False:
+        @overload
+        def f4(g: B) -> B: ...
+    else:
+        @overload
+        def f4(g: C) -> C: ...
+def f4(g): ...
+reveal_type(f4(A()))  # N: Revealed type is "__main__.A"
+reveal_type(f4(B()))  # E: No overload variant of "f4" matches argument type "B" \
+    # N: Possible overload variants: \
+    # N:     def f4(g: A) -> A \
+    # N:     def f4(g: C) -> C \
+    # N: Revealed type is "Any"
+reveal_type(f4(C()))  # N: Revealed type is "__main__.C"
+
+@overload
+def f5(g: A) -> A: ...
+if True:
+    if False:
+        @overload
+        def f5(g: B) -> B: ...
+    elif True:
+        @overload
+        def f5(g: C) -> C: ...
+def f5(g): ...
+reveal_type(f5(A()))  # N: Revealed type is "__main__.A"
+reveal_type(f5(B()))  # E: No overload variant of "f5" matches argument type "B" \
+    # N: Possible overload variants: \
+    # N:     def f5(g: A) -> A \
+    # N:     def f5(g: C) -> C \
+    # N: Revealed type is "Any"
+reveal_type(f5(C()))  # N: Revealed type is "__main__.C"
+
+[case testOverloadIfNestedFailure]
+# flags: --always-true True --always-false False
+from typing import overload
+
+class A: ...
+class B: ...
+class C: ...
+class D: ...
+
+@overload  # E: Single overload definition, multiple required
+def f1(g: A) -> A: ...
+if True:
+    @overload  # E: Single overload definition, multiple required
+    def f1(g: B) -> B: ...
+    if maybe_true:  # E: Condition cannot be inferred, unable to merge overloads \
+                    # E: Name "maybe_true" is not defined
+        @overload
+        def f1(g: C) -> C: ...
+        @overload
+        def f1(g: D) -> D: ...
+def f1(g): ...  # E: Name "f1" already defined on line 9
+
+@overload  # E: Single overload definition, multiple required
+def f2(g: A) -> A: ...
+if True:
+    if False:
+        @overload
+        def f2(g: B) -> B: ...
+    elif maybe_true:  # E: Name "maybe_true" is not defined
+        @overload  # E: Single overload definition, multiple required
+        def f2(g: C) -> C: ...
+def f2(g): ...  # E: Name "f2" already defined on line 21
+
+@overload  # E: Single overload definition, multiple required
+def f3(g: A) -> A: ...
+if True:
+    @overload  # E: Single overload definition, multiple required
+    def f3(g: B) -> B: ...
+    if True:
+        pass  # Some other node
+        @overload  # E: Name "f3" already defined on line 32  \
+                   # E: An overloaded function outside a stub file must have an implementation
+        def f3(g: C) -> C: ...
+        @overload
+        def f3(g: D) -> D: ...
+def f3(g): ...  # E: Name "f3" already defined on line 32

Error merging nested overloads
**Bug Report**

Mypy can't merge nested overloads. Those can happen if all are wrapped with `if TYPE_CHECKING` and combined with a nested conditional overload.

https://mypy.readthedocs.io/en/stable/more_types.html#conditional-overloads

**=> I'm working on a fix already and plan to open a PR soon.**

**To Reproduce**

```py
from typing import overload

class A: ...
class B: ...
class C: ...
class D: ...

@overload
def f1(g: A) -> A: ...
if True:
    @overload
    def f1(g: B) -> B: ...
    if True:
        @overload
        def f1(g: C) -> C: ...
        @overload
        def f1(g: D) -> D: ...
def f1(g): ...
```

**Expected Behavior**

Overloads should merge just fine.
```py
reveal_type(f1(A()))  # N: Revealed type is "__main__.A"
reveal_type(f1(B()))  # N: Revealed type is "__main__.B"
reveal_type(f1(C()))  # N: Revealed type is "__main__.C"
reveal_type(f1(D()))  # N: Revealed type is "__main__.D"
```

**Actual Behavior**

```
test.py:8: error: Single overload definition, multiple required
test.py:11: error: Name "f1" already defined on line 8
test.py:11: error: An overloaded function outside a stub file must have an implementation
test.py:18: error: Name "f1" already defined on line 8
```

**Your Environment**

- Mypy version used: mypy 0.960+dev.44993e6a18f852a9296786267ecf26ea730b4f31
- Mypy command-line flags: `mypy test2.py --always-true True --always-false False`


mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadNotImportedNoCrash mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCovariantOverlappingOverloadSignaturesWithSomeSameArgTypes mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplTypeVar mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCompatibilityOfIntersectionTypeObjectWithStdType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCovariantOverlappingOverloadSignaturesWithAnyType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplTypeVarProblems mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedGetitem mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testContravariantOverlappingOverloadSignaturesWithAnyType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedGetitemWithGenerics mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypingExtensionsOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadImplementationTypeVarWithValueRestriction mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadNeedsImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedLtAndGtMethods mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testImplementingOverloadedMethod mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadImplementationTypeVarDifferingUsage1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testSingleOverloadNoImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithFunctionType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedForwardMethodAndCallingReverseMethod mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadByAnyOtherName mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverrideOverloadSwapped mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadImplementationTypeVarDifferingUsage2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testVarArgsOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithDecoratedImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadedFunctionBody mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverrideOverloadSwappedWithExtraVariants mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testVarArgsOverload2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadDecoratedImplementationNotLast mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadedMethodBody mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithTypeObject mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverrideOverloadSwappedWithAdjustedVariants mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadImplementationNotLast mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCallToOverloadedFunction mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverrideOverloadedMethodWithMoreGeneralArgumentTypes mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedInitAndTypeObjectInOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testDecoratedRedefinitionIsNotOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedFunctionReturnValue mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverrideOverloadedMethodWithMoreSpecificArgumentTypes mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverlappingErasedSignatures mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplementationPy2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCallToOverloadedMethod mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverlappingOverloadSignatures mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingAndDucktypeCompatibility mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplementationError mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testContravariantOverlappingOverloadSignatures mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedMethodReturnValue mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithUntypedImplAndMultipleVariants mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingAndIntFloatSubtyping mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testPartiallyCovariantOverlappingOverloadSignatures mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplTooSpecificArg mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsWithDifferentArgumentCounts mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testPartiallyContravariantOverloadSignatures mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeCheckOverloadWithImplTooSpecificRetType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingVariableInputs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testGenericOverloadVariant mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCovariantOverlappingOverloadSignatures mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testIgnoreOverloadVariantBasedOnKeywordArg mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTypeInferenceSpecialCaseWithOverloading mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedInit mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithTupleMatchingTypeVar mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithTupleVarArg mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testKeywordArgOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testIntersectionTypeCompatibility mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testSingleOverloadStub mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument4 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testPreferExactSignatureMatchInOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testSingleOverload2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument15 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument5 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithDerivedFromAny mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNonconsecutiveOverloads mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument16 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument6 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNonconsecutiveOverloadsMissingFirstOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument7 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithBoundedTypeVar mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadOnOverloadWithType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNonconsecutiveOverloadsMissingLaterOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument8 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTupleInstance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTuple mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedCallWithVariableTypes mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument9 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCallableSpecificOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadOverlapWithTypeVars mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTupleEllipsisNumargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testCustomRedefinitionDecorator mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument10 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTupleEllipsisVariance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadOverlapWithTypeVarsWithValues mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument11 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument12 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithMethodOverrideAndImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadOverlapWithTypeVarsWithValuesOrdering mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument13 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithVariableArgsAreOverlapping mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithIncompatibleMethodOverrideAndImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithOverlappingItemsAndAnyArgument14 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsUsingAny mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadDetectsPossibleMatchesWithGenerics mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadAnyIsConsideredValidReturnSubtype mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadAgainstEmptyCollections mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapMixingOptionalArgsWithVarargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadFlagsPossibleMatches mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithNonPositionalArgs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadAgainstEmptyCovariantCollections mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithNonPositionalArgsIgnoresOrder mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapMixingOptionalArgsWithVarargs2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverlappingOverloadCounting mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapWithArgsAndKwargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPartialOverlapWithUnrestrictedTypeVarInClass mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadVarargsSelectionWithTuples mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapMixingNamedArgsWithKwargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapWithVarargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPartialOverlapWithUnrestrictedTypeVarInClassNested mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadVarargsSelectionWithNamedTuples mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapMixingNamedArgsWithKwargs2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapWithVarargs2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTypedDictDifferentRequiredKeysMeansDictsAreDisjoint mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadKwargsSelectionWithDict mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapWithVarargs3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapMixingNamedArgsWithKwargs3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapWithVarargs4 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadVarargInputAndVarargDefinition mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedTypedDictPartiallyOverlappingRequiredKeys mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadKwargsSelectionWithTypedDict mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadMultipleVarargDefinition mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapWithKwargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadVarargsAndKwargsSelection mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedTypedDictFullyNonTotalDictsAreAlwaysPartiallyOverlapping mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPossibleOverlapMixingNamedArgsWithVarargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadMultipleVarargDefinitionComplex mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithPartiallyOverlappingUnions mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedPartiallyOverlappingInheritedTypes2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadVarargsSelection mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedTotalAndNonTotalTypedDictsCanPartiallyOverlap mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithPartiallyOverlappingUnionsNested mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPartialOverlapWithUnrestrictedTypeVar mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionRespectsVariance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedPartiallyOverlappingInheritedTypes3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionIfParameterNamesAreDifferent mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedTypedDictsWithSomeOptionalKeysArePartiallyOverlapping mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedPartiallyOverlappingTypeVarsAndUnion mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPartialOverlapWithUnrestrictedTypeVarNested mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadPartiallyOverlappingTypeVarsIdentical mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoneWithoutStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedPartiallyOverlappingInheritedTypes1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionReturnFunctionsWithKwargs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedPartiallyOverlappingCallables mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoneWithStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithObjectTypevarReturn mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionWithDifferingLengths mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadNotConfusedForProperty mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsNoneAndTypeVarsWithNoStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithBadObjectTypevarReturn mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionReturnBasic mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionWithMixOfPositionalAndOptionalArgs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithTypevarWithValueRestriction mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionReturnMultipleArguments mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsNoneAndTypeVarsWithStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithMixedTypevars mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowTypeNoStrictOptional2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithFunctionTypevarReturn mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowTypeNoStrictOptional1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithMixedTypevarsInnerMismatch mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowTypeWithStrictOptional2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithNonGenericDescriptor mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowTypeWithStrictOptional1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithNonGenericDescriptorLookalike mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithInconsistentClassMethods mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithMixedTypevarsTighterBound mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowTypeNoStrictOptional3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithSwappedDecorators mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithGenericDescriptor mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowTypeWithStrictOptional3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadingInferUnionReturnWithTypevarsAndValueRestrictions mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithGenericDescriptorLookalike mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadFaultyClassMethodInheritance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowWhenBlacklistingSubtype mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadLambdaUnpackingInference mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferUnionReturnWithInconsistentTypevarNames mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadClassMethodMixingInheritance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsAndNoReturnNarrowWhenBlacklistingSubtype2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithClassMethods mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadClassMethodImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithStaticMethods mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadStaticMethodImplementation mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testUnionMathOverloadingReturnsBestType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithInconsistentStaticMethods mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsWithNoneComingSecondAreAlwaysFlaggedInNoStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOptionalIsNotAUnionIfNoStrictOverloadStr mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testUnionMathTrickyOverload1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithSwappedDecorators2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsWithNoneComingSecondIsOkInStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadAndSelfTypes mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testUnionMathTrickyOverload2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadFaultyStaticMethodInheritance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadAndClassTypes mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testTooManyUnionsException mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadStaticMethodMixingInheritance mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOptionalIsNotAUnionIfNoStrictOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testSafeDunderOverlapInSubclass mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNestedOverloadsTypeVar mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testManyUnionsInOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadBoundedTypevarNotShadowingAny mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNestedOverloadsTypeVarOverlap mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsTypesAndUnions mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testAnyIsOKAsFallbackInOverloads mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testUnsafeDunderOverlapInSubclass mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testBadOverloadProbableMatch mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNestedOverloadsMutuallyRecursive mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadErrorMessageManyMatches mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadsIgnorePromotions mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testDisallowUntypedDecoratorsOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadConstrainedTypevarNotShadowingAny mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testDisallowUntypedDecoratorsOverloadDunderCall mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedInIter mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadBadArgumentsInferredToAny2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadBadArgumentsInferredToAny1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testNestedOverloadsNoCrash mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadDeferredNode mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadInferringArgumentsUsingContext1 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testVeryBrokenOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadedToGeneric mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTwoTypeArgs mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testLiteralSubtypeOverlap mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testVeryBrokenOverload2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithObjectDecorator mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadTypeVsCallable mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadWithErrorDecorator mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfBasic mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfNotMerging mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfOldStyle mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfMerging mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfSysVersion mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfSkipUnknownExecution mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfElse3 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfElse mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfNotMergingDifferentNames mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfElse2 mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfUnconditionalFuncDef mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfMixed mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfSplitFunctionDef mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfDontSkipUnrelatedOverload mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadItemHasMoreGeneralReturnType mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfNestedFailure
mypy/test/testcheck.py::TypeCheckSuite::check-overloading.test::testOverloadIfNestedOk